OpenId is not returning Email etc, I don’t understand why but no matter what I try (implicitly and explicitly) requesting the Email property is simply not returning anything. If i check the okta mapping it does properly fill.
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(options =>
{
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.Authority = Configuration["OktaAuth:OktaDomain"] + "/oauth2/default";
options.RequireHttpsMetadata = true;
options.ClientId = Configuration["OktaAuth:OktaClientId"];
options.ClientSecret = Configuration["OktaAuth:OktaClientSecret"];
options.ResponseType = OpenIdConnectResponseType.Code;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("openid");
options.Scope.Add("profile");
options.SaveTokens = true;
options.TokenValidationParameters = new TokenValidationParameters
{
NameClaimType = "name",
RoleClaimType = "groups",
ValidateIssuer = true
};
});
What have I tried?
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("email");
options.ClaimActions.MapUniqueJsonKey("email", "email");