SSO and token error when setting up a project

Adel Mozip 1 Reputation point
2021-10-20T15:38:25.563+00:00

I'm getting an error right after setting up azure ad authentication.

An unhandled exception occurred while processing the request.
SecurityTokenSignatureKeyNotFoundException: IDX10501: Signature validation failed. Unable to match key:
kid: 'System.String'.
Exceptions caught:
'System.Text.StringBuilder'.
token: 'System.IdentityModel.Tokens.Jwt.JwtSecurityToken'.
Microsoft.IdentityModel.Tokens.InternalValidators.ValidateLifetimeAndIssuerAfterSignatureNotValidatedJwt(SecurityToken securityToken, Nullable<DateTime> notBefore, Nullable<DateTime> expires, string kid, TokenValidationParameters validationParameters, StringBuilder exceptionStrings)

Exception: An error was encountered while handling the remote login.
Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<TOptions>.HandleRequestAsync()

I am not using JWT tokens. I have double checked the credentials and urls.

What could I be missing?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,472 questions
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 21,621 Reputation points Microsoft Employee
    2021-10-29T23:49:01.033+00:00

    Hi @Adel Mozip , It's very hard to trace the issue without seeing the code. If you can post the code I can look into a fix for you. If you were following a document or sample I would suggest deleting it and starting over. Sometimes environmental errors can occur. Please let me know if you resolve the issue.

    Best,
    James