Allow to set a TokenGenerator to override default implementation.#94
Allow to set a TokenGenerator to override default implementation.#94iamluc wants to merge 1 commit intoFriendsOfSymfony:masterfrom
Conversation
It eases the use of JWT or other token types.
|
@GuilhemN Hi, is there any chance to get this merged in the nearest time? |
|
ping @GuilhemN |
|
Well this needs to be reviewed first but I don't know this library well enough to do it. |
cored0wn
left a comment
There was a problem hiding this comment.
Good implementation and very useful.
Especially for people who has to implement oauth extensions like openid connect (such as me).
| */ | ||
| public function setTokenGenerator(TokenGeneratorInterface $tokenGenerator) | ||
| { | ||
| $this->tokenGenerator = $tokenGenerator; |
There was a problem hiding this comment.
The DI container should inject the specific generator so the value is set.
If no specific generator is available, then the default generator should be used.
| * @ingroup oauth2_section_4 | ||
| * @see OAuth2::genAuthCode() | ||
| * | ||
| * @deprecated since 1.3, will be removed in 2.0. Use a TokenGenerator instead. |
There was a problem hiding this comment.
This method should be call the default generator method internally.
|
|
||
| class RandomTokenGenerator implements TokenGeneratorInterface | ||
| { | ||
| public function genAccessToken(IOAuth2Client $client, $data, $scope = null, $access_token_lifetime = null, $issue_refresh_token = true, $refresh_token_lifetime = null) |
There was a problem hiding this comment.
This parameters should be extraced as class members and set over an constructor or setter methods.
|
Are there any plans to merge it? |
|
@Valantir007 I guess @iamluc would have to make an effort and fix the comments added before merging is on the table. The PR has been sitting like this since it was created and I have my doubts whether the OP is keen on implementing the changes. |
|
@Valantir007 If you'd like to submit a new PR fixing the comments that would definitely help :) |
It eases the use of JWT or other token types.
Could also fix #86