As per the OpenID Connect specification is sub
claim part of openid
scope or profile
scope? I could not find that information
Update1
I am using IdentityServer3 for authentication. Client is making the request to the server as below. In response I don't get sub
claim which is required as per the Open ID Connect specification. However response does include http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier
which has same value as sub
Is the nameidentifier
same as sub
claim.
Here is client request
public void Configuration(IAppBuilder app)
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "Cookies"
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
Authority = "https://localhost:44314/identity",
Scope = "openid",
ClientId = "LocalHostMvcClient",
RedirectUri = "http://localhost:34937/",
ResponseType = "id_token",
SignInAsAuthenticationType = "Cookies",
}
}
id_token response
Update 2
based on the comments below I have updated client's startup file
private void TurnOffMicrosoftJWTMapping()
{
//The long claim names come from Microsoft’s JWT handler trying to map some claim types to .NET’s ClaimTypes class types.
//We can turn off this behavior with the following line of code (in Startup).
//This also means that we need to adjust the configuration for anti-CSRF protection to the new unique sub claim type:
AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.Subject;
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
}
and then call this method in client's startup
public class Startup
{
public void Configuration(IAppBuilder app)
{
TurnOffMicrosoftJWTMapping();
//configure OpenIDConnect request here
}
}
sub
string - Identifier for the End-User at the Issuer. - so this can have any value ? – Jaimeejaimes