Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Make it possible to extend/hook Security stamp validation to enable keeping current cookie claims when renewing cookie #958

@brockallen

Description

@brockallen

Vital claims that might only be captured at login time are lost when the security stamp is renewed. The implementation itself even has a comment to review this behavior:

var user = await _signInManager.ValidateSecurityStampAsync(context.Principal);
if (user != null)
{
    // REVIEW: note we lost login authenticaiton method
    context.ReplacePrincipal(await _signInManager.CreateUserPrincipalAsync(user));
    context.ShouldRenew = true;
}

I'd suggest simply using the current ticket's claims, but replacing the security stamp. If it's deemed that this is not to be changed/fixed, then perhaps add a flag to allow both behaviors?

This came up as part of using ASP.NET Identity within IdentityServer4: DuendeArchive/IdentityServer4#277

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions