-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specifying token class to be used #500
Comments
Hi, Thanks for getting in touch. I'm away until the 8th April, but will get Please could you flesh out this issue as much as you can so I can think Thanks, Alex
|
Hi @tigrang, I'm facing the same issue here: composing Doctrine token entities pulling data from Legue\Oauth2\Server\Entities*Entity, and I assume this is going to be a recurrent issue because of the spread of Doctrine. I'm thinking two options to avoid this extra step:
With the first option additionally the developer can be responsible of generating token identifiers instead of being restricted to what the library generates (even though using random_bytes is the correct way) |
@tigrang @juliangut PR #497 adds the feature for access tokens I think. A new method is added to the AccessTokenRepository 'createNewToken'. This will instantiate the token in the repository so you will have the opportunity to return an object that can be persisted by Doctrine. We could also add createNewToken methods to the auth code and refresh token repository. I could extend the PR, if you like what I am proposing. |
@frederikbosch having a method on the repository class is what I had in mind. |
Please @frankdejonge add the methods to the repositories, I'll suggest though you change their signature as they don't need any parameter public function getNewAccessToken();
public function getNewRefreshToken();
public function getNewAuthCode(); |
@juliangut Will do, and will also changes the signature. Will update the PR later today or tomorrow. p.s. @frankdejonge You were mistakenly @-mentioned by @juliangut. |
Ahhh! sorry for the missleading mention just typed @ and f and pressed enter 😞 |
Hehe, he is going to be super mad at you! |
Agree with @juliangut those methods are a very welcome addition and would allow for some great customizations as well as better framework integrations. |
@lucadegasperi @juliangut New PR added with the requested methods. |
@frederikbosch awesome! |
I believe this has now been resolved by #512 |
I am using Doctrine to persist tokens with an entity that implements AccessTokenEntityInterface.
I have to create a new doctrine entity in
persistNewAccessToken()
and use setters/getters to copy over values fromAccessTokenEntity
that is passed and my doctrine entity in order for doctrine to work.How does adding the ability to configure the class that is instantiated in
issueAccessToken
,issueRefreshToken
, andissueAuthCode
before its passed to persist function sound?The text was updated successfully, but these errors were encountered: