I am trying to configure the OpenIdConnectOptions
and OAuthOptions
in order to solve an issue where custom claims are not mapped to the cookie. I'm running the ASP.NET Core 3.0 Preview 5 react SPA template. Basically, the gist of the Identity configuration looks like this:
services.AddDefaultIdentity<ApplicationUser>()
.AddEntityFrameworkStores<ApplicationDbContext>();
services.AddIdentityServer()
.AddApiAuthorization<ApplicationUser, ApplicationDbContext>();
services.AddAuthentication()
.AddIdentityServerJwt();
services.Configure<IdentityOptions>(options => {
// These options are set
});
services.Configure<OpenIdConnectOptions>(options => {
// These are not set
options.ClaimActions.MapUniqueJsonKey("MyCustomClaim", "MyCustomClaim");
options.GetClaimsFromUserInfoEndpoint = true;
});
services.Configure<OAuthOptions>(options => {
// Neither are these
options.ClaimActions.MapUniqueJsonKey("MyCustomClaim", "MyCustomClaim");
});
Now, from the logs I can verify that services.Configure<IdentityOptions>
is executed, but neither services.Configure<OpenIdConnectOptions>
nor services.Configure<OAuthOptions>
are executed at all. I was under the impression that Identity server basically is an OpenIdConnect implementation on top of an OAuth-server. So why is it that these services aren't used? How can I set these options for the Identity server?