I am using the below code to authorize
.AddJwtBearer(schemaname, options =>
{
options.Audience = AddJwtBearerConfigurations[xxx].Audience;
options.Authority = AddJwtBearerConfigurations[xxx].Authority;
options.RequireHttpsMetadata = false;
options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters()
{
ValidateAudience = true,
ValidateIssuer = false,
ValidateIssuerSigningKey = false,
ValidateLifetime = false,
ValidateTokenReplay = false,
RequireSignedTokens = false,
};
})
I am using Application ID URI as Audience and https://login.microsoftonline.com/{tenantID} as Authority I keep getting error
WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid" WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid" WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid" WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid" WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid" WWW-Authenticate: Bearer error="invalid_token", error_description="The signature key was not found"
I tried clinetID, decode the jwt and use "aud" and still getting 401
any help
Update, i started sending IssuerSigningKey and now error i dug out of output
Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler: Information: {schemaName} was not authenticated. Failure message: Object reference not set to an instance of an object.