I am writing an ASP.Net Core web application and using UseOpenIdConnectAuthentication to connect to IdentityServer3. By emulating their ASP.Net MVC 5 sample, I am trying to convert claims received back from Identity Server to remove " low-level protocols that are definitely not needed ." In MVC 5, they add a handler for SecurityTokenValidated Notification, which collapses the AuthenticationTicket for one with only the required claims.
In ASP.Net Core, to make an equivalent, I thought that I would need to handle OnTokenValidated in OpenIdConnectEvents . However, at this stage no additional information about the area appears. If I process OnUserInformationReceived , additional information is present, but stored on the user, and not on the main one.
None of the other events seems like an obvious place for the final removal of claims that are not interesting to me when I save after authentication is completed. Any suggestions gratefully received!
asp.net-core claims-based-identity identityserver3
Piers lawson
source share