-
-
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
Domain events do not provide information about tokens #1145
Comments
Any comments on this are very much welcome. I can create a PR if you'd like. |
Isn't your custom property The moment your implementation of |
Late response, but no that won't help. The problem is that we need our logic to run AFTER the token is issued and BEFORE the http response is generated. I'm thinking about suggesting a small change that would introduce two new event classes to make our situation possible until #1184 is fully implemented. In short, it would introduce |
Just checked. It seems my issue is solved in #1211 that was released in 8.3.0. I will close this issue if I can use this solution. |
please tell me you are not modifying the token object thru an dispatched/submitted event |
@GDmac In our case a user has to go through MFA. When MFA was succesful, the token's property But when the user's client requests a new access token with a refresh token, the new access token needs to have The token itself remains unmodified and the property |
So, you are setting (modifying) the mfa_validated property on the token you receive with the event? My suggestion was that when the token expires you fetch the refreshtoken anyway from the repository. |
Great suggestion. I will definitely look into that, thanks. |
When a domain event is emitted the receiver of that event has no way to access information about for instance the access/refresh-token that was issued.
Situation
Our access tokens have a supplementary property called
mfa_validated
. That property's value is eithertrue
orfalse
. When issuing a new access token that was requested via a refresh token the new access token should inherit the value of that property from the previous access token.We're unable to find out what the previous access token or refresh token was. We are also unable to find out what the new access token is. This results in our users having to redo the MFA steps when the access token is expired but the refresh token is still valid.
Proposal
League\OAuth2\Server::ACCESS_TOKEN_ISSUED
: Provide the new access token to theRequestEvent
when a new access token was issued.League\OAuth2\Server::REFRESH_TOKEN_ISSUED
: Provide the new refresh token to theRequestEvent
when a new refresh token was issued.Or provide any other way to retrieve the access token or refresh token related to the event that was emitted.
The text was updated successfully, but these errors were encountered: