Skip to content
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

Added Identity Token to TokenRefreshEventArgs #367

Merged
merged 2 commits into from
Sep 26, 2022

Conversation

fmgracias
Copy link
Contributor

This change allows updating the identity token cached at the client with the latest identity token coming from token renewal.

The motivation for this change is that claims can change during the runtime of the identity client (in my case, it's user claims related to permissions).

The alternative approach would be to call /userinfo endpoint, which we consider an avoidable overhead.

This change allows updating the identity token cached at the client with the latest identity token coming from token renewal
@leastprivilege
Copy link
Contributor

Thanks will have a look after holidays.

@fmgracias
Copy link
Contributor Author

Thanks will have a look after holidays.

Thank you for taking this into consideration @leastprivilege

Enjoy your holidays ✌️

@fmgracias
Copy link
Contributor Author

Hey @leastprivilege, this is just a friendly reminder for you to check this PR.

I wanted to avoid having to fork the repo for such a small tweak.

Thank you in advance for your consideration!

@@ -17,10 +17,11 @@ public class TokenRefreshedEventArgs : EventArgs
/// <param name="accessToken">The access token.</param>
/// <param name="refreshToken">The refresh token.</param>
/// <param name="expiresIn">The expires in.</param>
public TokenRefreshedEventArgs(string accessToken, string refreshToken, int expiresIn)
public TokenRefreshedEventArgs(string accessToken, string refreshToken, string identityToken, int expiresIn)
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is that this is introducing a breaking change because you changed the signature.

I would prefer to move identityToken to the end of the param list and make it optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood. New changes pushed

@fmgracias fmgracias requested review from leastprivilege and removed request for brockallen September 19, 2022 11:29
@fmgracias
Copy link
Contributor Author

Didn't mean to remove @brockallen from the reviewers. Not sure how that happened and I don't have permission to add him back

@leastprivilege leastprivilege merged commit 3656b79 into IdentityModel:main Sep 26, 2022
@fmgracias
Copy link
Contributor Author

@leastprivilege thanks for the review.
Can you release a new version with those changes please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants