Not receiving Claim Sid

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?

Hey there @luis.vasquez welcome to the community!

I’m unfortunately not super familiar with .Net, but I’m curious if you’re working with access and ID tokens here? NameIdentifier makes me think SAML - As far as I’m aware the sid claim exists in ID tokens in the context of OIDC. If you are working with access/ID tokens (jwts), does the sid claim exist if you decode at jwt.io?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.