mirror of
https://github.com/DuendeSoftware/products
synced 2026-05-24 09:28:24 +00:00
Upadted the IdentityServerAspNetIdentity template to use an edited version of claims, similar to the other templates.
This commit is contained in:
parent
7e1230861b
commit
cb722f6df3
1 changed files with 2 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ public class Callback : PageModel
|
|||
// remove the user id and name identifier claims so we don't include it as an extra claim if/when we provision the user
|
||||
var claims = externalUser.Claims.ToList();
|
||||
claims.RemoveAll(c => c.Type is JwtClaimTypes.Subject or ClaimTypes.NameIdentifier);
|
||||
user = await AutoProvisionUserAsync(provider, providerUserId, externalUser.Claims);
|
||||
user = await AutoProvisionUserAsync(provider, providerUserId, claims.ToList());
|
||||
}
|
||||
|
||||
// this allows us to collect any additional claims or properties
|
||||
|
|
@ -113,8 +113,7 @@ public class Callback : PageModel
|
|||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1851:Possible multiple enumerations of 'IEnumerable' collection", Justification = "<Pending>")]
|
||||
private async Task<ApplicationUser> AutoProvisionUserAsync(string provider, string providerUserId, IEnumerable<Claim> claims)
|
||||
private async Task<ApplicationUser> AutoProvisionUserAsync(string provider, string providerUserId, List<Claim> claims)
|
||||
{
|
||||
var sub = Guid.NewGuid().ToString();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue