Open pounard opened 8 years ago
This project doesn't implement the Open ID Connect specification yet (and won't for a while).
The authorization codes are distributed as embedded payloads to reduce DB hits in high request environments when a client converts to an access token.
The only way currently to change this would be to extend the grant and the AuthorizationCodeRepositoryInterface
to support saving the value to the database
Yet, this is not OpenID specific, but the RFC doesn't opiniate about what exactly is the code, wouldn't it be useful to provide a repository interface for this, for which the default implementation would be to crypt/uncrypt ?
I'm not that comfortable with extending the API, I'd like my future updates to go smoothly :)
If the idea's of adding another repository + interface + default implementation is OK for you, would you potentially accept a PR ?
Actually I found a way better solution, I am overriding the CryptTrait to something that instead of crypting will load and save into the database.
This probably would worth an injectable component using an clean interface for this instead of the actual trait, so wouldn't have to actually extend the grant implementation in order to override the trait itself.
It would also be cleaner and easier for unit testing, and also for integrating for such use cases.
I'm moving v6 away from using the crypt trait (and removing the requirement for symmetric key pairs too if you don't want to use them). Going forward an auth code is likely to be a JWT which should be smaller than the current encrypted payload
Good news, thanks.
I am using this API in an environment with OpenAM as client, and experience a blocking issue: when your API sends the redirect response, it sends back as code a serialized, encrypted JSON structure containing the request and other few data, as you can see in
src/Grant/AuthCodeGrant.php
:Problem is that OpenAM has an hardcoded request size limit, as you can see there:
So it is unable to validate any response from this API. Looking at the OpenID Connect 1.0 spec with can see:
And later on in RFC6749, in the
code
definition:If I look up a bit deeper in the Open ID Connect spec there, and it states:
So if I understand correctly, the code can be anything, really, and those information you send encrypted should probably just a generated unique identifier instead, stored on the server side.
Is there any way to do this ?