We have an ASP.NET Core Web API that I want to secure with Microsoft Graph Access token. The graph token is valid and I can do graph call it works fine.
However, If I try to access the ASP.NET Core Web API which is configured with JWT Bearer authentication, it gives the following error.
Bearer error="invalid_token", error_description="The signature key was not found
Am I missing some configurations to configure or this is a problem with graph token? Here is how the authentication is configured.
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.TokenValidationParameters = new TokenValidationParameters()
{
ValidateIssuer = false, // For multi tenant
ValidateIssuerSigningKey = false,
ValidateAudience = false // This is for testing
};
});
The same configurations works fine with Azure AD Access Token.