I have VS2013 MVC5 project with Individual User Accounts. I modified Startup {Configuration(IAppBuilder app)}
so that UseOpenIdConnectAuthentication
is the only allowed authentication.
Users can register in the AspNetIdentity DB using the out of the box MVC project template plumbing. After registration, Users login with OIDC.
The OpenID Connect STS (IdentityServer3 with AspNetIdentity) returns a security token with claims and roles. These claims are available from the authenticated ClaimsPrincipal
in the Request.GetOwinContext().Authentication.User
.
However these claims are missing from the Controller.User
(Current HTTP Request context).
Is it a good thing to make the two ClaimsPrincipal
match?
QUESTION: If so how and where do I do that? I'm not an expert and wonder what about OpenIdConnectAuthenticationNotifications.SecurityTokenValidated
or
Application_PostAuthenticateRequest
?
I realize this is a side-effect of mixing MVC5 System.Web
with OWIN middleware for OpenIdConnect, rather than the default MVC5 project authentication middleware.