-
Notifications
You must be signed in to change notification settings - Fork 375
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
Add proposed changes for token persistence removal #2208
Add proposed changes for token persistence removal #2208
Conversation
…auth-oauth into new-claim-token-persist
…auth-oauth into new-claim-token-persist
… TokenProvider. Refactor RevocationProcessor and TokenProvider.
…r non token token persistence scenarios.
…auth-oauth into new-claim-token-persist
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
Ran integration tests for the previously failed test OAuth2ServiceJWTGrantTestCase locally and it passed with the lastest changes. |
Proposed changes in this pull request
Related wso2/api-manager#1664.
This PR is a continuation of following PRs for token persistence removal feature.
PR #2091 and #2176 introduces new extensions point to plug a custom solution for non persistence feature. Basically it abstracts out the database persistence logic during token generation, refresh token handling, token revocation, token introspection and OIDC user info endpoint response handling. PR #2179 introduces abstractions to handle token revocation events due to user change events. This PR adds the following changes on top of above 3 PRs.
I am utilizing the following configuration already available in identity.xml but not yet templated. There are no usages of the config other than in AccessTokenDAO (even still the enabling the config is not providing the intended behavior).
deployment.toml
identity.xml
Introduced a new unique claim
entity_id
to the JWT access token to identify the principle subject of the token. Eg: User in case of Application_User access tokens, Client Application in case of Application tokens. This is needed to validate the tokens when no persistence is available for the JTI and if there are in direct token revocation events triggered due to client application or user change events (Eg: client secret regeneration, user password change etc).Along with this feature, to identify if the provided refresh token JWT, a new claim is introduced as
is_consented
. For that, in Refresh Grant flow, we need to pass this information through RefreshTokenValidationDO to the code where we generate the new token.Refactored the code in Add extension support for token validation during token introspection and user info endpoints #2176 Add extensions for token persistence removal feature #2091 as follows.
TokenRevocationProcessor
'sgetRevocableRefreshToken
method. As we have introduceAccessTokenProvider
(former) to verify access tokens, it make sense to move the refresh token handling to the same interface.isRefreshToken
inTokenRevocationProcessor
is no longer needed, as we are not keeping the token type in the revoked JTI table with this feature. Refreshtokens can be handled in the same way as access tokens if token type hint is not provided..getAccessTokenDAO().getAccessToken
. This is same asOAuth2Util.findAccessToken()
, but latter go through the oauth cache.With the above refactoring, I have change theOAuth2Service.revokeTokenByOAuthClient
to go throughTokenProvider..getVerifiedAccessToken()
.When should this PR be merged
Along with wso2/carbon-identity-framework#5073.
Follow up actions
N/A
Checklist (for reviewing)
General
Functionality
Code
Tests
Security
Documentation