Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Update clearAccessToken method#374

Open
dnys1 wants to merge 3 commits intoCAAPIM:developfrom
dnys1:clear-access-token
Open

Update clearAccessToken method#374
dnys1 wants to merge 3 commits intoCAAPIM:developfrom
dnys1:clear-access-token

Conversation

@dnys1
Copy link
Copy Markdown

@dnys1 dnys1 commented Oct 5, 2020

Issue

Calling the MssoContext.clearAccessToken method clears all keys in the private token storage. If this is done while a valid refresh token is present but a valid ID token is not, the next refresh call, which will default to using the ID token, will fail.

Changes

This MR introduces a separate method clearAccessAndRefreshTokens for the cases where both token types should be cleared from the private token storage, and changes the current implementation of clearAccessToken to clear only the access token while leaving the refresh token intact.

The logic in AccessTokenAssertion.findAccessToken is also updated for the case where the access token has been cleared, but a valid refresh token is available. The library should first try to update with the refresh token before reverting to the ID token.

Copy link
Copy Markdown

@graju256 graju256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I assume we've traced out all the instances where MssoContext.clearAccessToken is getting called.

@dnys1
Copy link
Copy Markdown
Author

dnys1 commented Oct 7, 2020

Thank you @graju256. I did look at all calls to clearAccessToken but had to make an educated guess of the intention (whether to clear access and refresh or just access). A double check on this would be great. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants