Needs work
Project:
Simple OAuth (OAuth2) & OpenID Connect
Version:
6.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 May 2020 at 07:51 UTC
Updated:
17 Sep 2025 at 02:35 UTC
Jump to comment: Most recent
Comments
Comment #2
nicrodgersI think this would actually be difficult to implement given that the oauth2-server doesn't currently support taking keys directly, but requires the path to the files on the filesystem. See https://github.com/thephpleague/oauth2-server/issues/1007
Comment #3
bradjones1Comment #6
afi13 commentedComment #9
bojan_dev commentedI like the idea, thanks for sharing.
But the current MR wouldn't work because it's tightly coupled, so if you don't have the key module installed you will get errors.
I wonder if we should make the key module dependent in the 6.0, or implement a loose coupled implementation, e.g: a key service which gives the possibility to swap out the key storage.
@e0ipso & @bradjones1 what do you guys think?
Comment #10
afi13 commentedKey module is used only if installed, why do you think you will have errors without the module? I've added moduleExists condition to the settings form, without the Key module installed you can't change the storage type. Of course, it can be done better and a solution with some key storage plugins or a service would be more flexible, but even now it should work without errors I guess.
Comment #11
bojan_dev commentedIf you take a look on the 'AuthorizationServerFactory.php', 'ResourceServer.php' and 'simple_oauth.services.yml' files, you will see that you have added there the 'key.repository' service (which is defined in the key module) as a dependency on the constructors.
Comment #12
afi13 commentedoh, I see, you are right
Comment #13
kopeboyThis would be very nice and I guess more secure!
(fixed Key module link)
Comment #15
anicotoI have this issue on a production site but this ticket haven't been updated in 2 years. I could try to rebase the branch but before that, have someone found a better workaround?
Comment #17
rakugaki commentedhave updated the pr to work with current release.
but i don't think its really in a merge-able state.
need to remove the hard dependency on key and wrap all the key related stuff in `if ($moduleHandler->moduleExists('key'))`.... but i dont particularly want to invest time in that if there is little interest from other users and clear direction from the maintainers that its an acceptable solution.
edit: to anyone messing about with the pr, you will want to base64 encode the keys before putting them in your .env file. eg:
cat config/simple_oauth/keys/public.key | base64 -w 0