Hi Experts,
I got some problems in OpenIdConnectEvents in startup.cs that located in AspNetCore MVC Clinet project.
here is the code that i found in some example of identity server.
OnTokenValidated = tokenValidatedContext => { var identity = tokenValidatedContext.Ticket.Principal.Identity as ClaimsIdentity; var subjectClaim = identity.Claims.FirstOrDefault(z => z.Type == "sub"); var newClaimsIdentity = new ClaimsIdentity( tokenValidatedContext.Ticket.AuthenticationScheme, "given_name","role"); newClaimsIdentity.AddClaim(subjectClaim); tokenValidatedContext.Ticket = new AuthenticationTicket( new ClaimsPrincipal(newClaimsIdentity), tokenValidatedContext.Ticket.Properties, tokenValidatedContext.Ticket.AuthenticationScheme); return Task.FromResult(0); },
I cannot find the tokenValidatedContext.Ticket. Is there any replaceent ? I used the IdentityServer 2.02. Please help me.