Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Keep previous refresh token if not updated during refresh #46

Merged

Conversation

hybrid2102
Copy link

What issue does this PR address?

After refreshing the AccessToken, the response may not contain a new RefreshToken (maybe because the previous one is not expired).

With this commit, the previous RefreshToken will be provided instead of a null value.

Important: Any code or remarks in your Pull Request are under the following terms:

If You provide us with any comments, bug reports, feedback, enhancements, or modifications proposed or suggested by You for the Software, such Feedback is provided on a non-confidential basis (notwithstanding any notice to the contrary You may include in any accompanying communication), and Licensor shall have the right to use such Feedback at its discretion, including, but not limited to the incorporation of such suggested changes into the Software. You hereby grant Licensor a perpetual, irrevocable, transferable, sublicensable, nonexclusive license under all rights necessary to incorporate and use your Feedback for any purpose, including to make and sell any products and services.

(see our license, section 7)

Copy link
Member

@josephdecock josephdecock left a comment

Choose a reason for hiding this comment

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

IdentityServer always returns the refresh token (either the existing one or a new one if we rotated). But, the spec says that this is optional, so I think this is probably a fine change to make. I would like to see a test of this added though.

(H) The authorization server authenticates the client and validates the refresh token, and if valid, issues a new access token (and, optionally, a new refresh token).

@brockallen
Copy link
Member

@hybrid2102 Are you able to add such a test?

@hybrid2102
Copy link
Author

@hybrid2102 Are you able to add such a test?

I sincerely apologize for the delay and for my current inability to add such a test. 🙇‍♂️

Test confirms that when we get a refresh token response without a refresh token in it, we continue to use the old refresh token.
@josephdecock josephdecock merged commit f398940 into DuendeSoftware:main May 5, 2024
5 checks passed
@josephdecock josephdecock changed the title after refreshing the token, if the response does not contain a new Re… Keep previous refresh token if not updated during refresh May 6, 2024
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.

3 participants