Signature validation failure when switching from Okta preview to production

.NET Framework 4.6

Our code is similar to:

The app works fine with Okta preview. Preview org url is:

When we switch the app over to production with Org url:

we get the following exception. Any idea what the issue might be?

Exception information:
Exception type: SecurityTokenSignatureKeyNotFoundException
Exception message: IDX10501: Signature validation failed. Unable to match keys:
kid: ‘[PII is hidden]’,
token: ‘[PII is hidden]’.
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature(String token, TokenValidationParameters validationParameters)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(String token, TokenValidationParameters validationParameters, SecurityToken& validatedToken)
at Microsoft.Owin.Security.OpenIdConnect.OpenIdConnectAuthenticationHandler.d__9.MoveNext()

Hi @kleinbiker

On the production org, do you have the option to create custom authorization servers? This should be available under Admin >> Security >> API >> Authorization Servers.

I will check with the admins and get back to you on that.

BTW, the exception above is when validating the id_token, not access_token. Isn’t the custom auth servers for the scenario when access_token is used for authorization? For our use case is sufficient, the only thing we do with the auth_token we get back is call Okta for userinfo.

I saw in another thread (Error: The signature key was not found) where someone was running to similar problems and ended up disabling the validation of the id_token. Wondering whether we have to go down that path.

Anyway will find out about the ability to create custom auth servers.


HI @kleinbiker

Can you please open a support case with in order to have this issue investigated? On the Okta authorization server, there should not be any problems in gathering the signing keys for ID tokens.

Did you update your keys endpoint within the app?