Hi there!
I’m new on Auth0 and I working on a Blazor Net.Core application where I’m using the RemoteAuthenticatorView component on UI and I’ve configured the Auth0 Authetication on API like that:
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, c =>
{
c.Authority = $"https://{builder.Configuration["Auth0:Domain"]}";
c.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
{
ValidAudience = builder.Configuration["Auth0:Audience"],
ValidIssuer = $"https://{builder.Configuration["Auth0:Domain"]}"
};
});
It’s working fine! My problem is that I can’t recover the Sid Claim from the User context, only the NameIdentifier but I do need the Sid:
var sid = HttpContext!.User.FindFirst(ClaimTypes.Sid)?.Value; //returns null
var identify= HttpContext!.User.FindFirst(ClaimTypes.NameIdentifier)?.Value; //returns value
Can anyone help me?