mirror of
https://github.com/bitwarden/server
synced 2026-01-02 16:43:25 +00:00
fix(identity): [PM-21975] Add Security Stamp claim to persisted grant
* Added Security Stamp claim to refresh_token * Linting * Added better comments. * Added clarification to naming of new method. * Updated comments. * Added more comments. * Misspelling
This commit is contained in:
@@ -72,6 +72,10 @@ public class ProfileService : IProfileService
|
||||
|
||||
public async Task IsActiveAsync(IsActiveContext context)
|
||||
{
|
||||
// We add the security stamp claim to the persisted grant when we issue the refresh token.
|
||||
// IdentityServer will add this claim to the subject, and here we evaluate whether the security stamp that
|
||||
// was persisted matches the current security stamp of the user. If it does not match, then the user has performed
|
||||
// an operation that we want to invalidate the refresh token.
|
||||
var securityTokenClaim = context.Subject?.Claims.FirstOrDefault(c => c.Type == Claims.SecurityStamp);
|
||||
var user = await _userService.GetUserByPrincipalAsync(context.Subject);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user