Unable to retrieve claims & identity from token
Recently i have been unable to retrieve organization and claims in general from a setup that has been working.
I am using .NET with React
i am now trying this to no avail
as mentioned, this setup has been working, but suddenly stopped working.
When inspecting the token everything seems to be working fine and i can see the claims in jwt.io
15 Replies
i failed to mention that it currently works in production, but not locally. But it has worked locally too
Hi @LIFE,
Good to hear from you and sorry that you are experiencing this issue.
My .NET expert team mate is on leave today but is back tomorrow.
I can see from your message that it works in production but not locally.
So is it okay if I only get my team mate to look into this issue tomorrow?
yes, no hurry. Thank you Oli!
Hey LIFE,
My team mate was looking into this issue today and it didnt seem straightforward. He will continue to look into this issue on Monday.
I see, thanks for the update!
Still looking into this issue @LIFE
Apologies for the inconvenience.
Not a problem :)
could it be related to: https://stackoverflow.com/a/78063798/3712531
What should happen next is that your .NET API calls the discovery endpoint at the path .well-known/openid-configuration. Then the jwks_uri value is stored.And that the .NET API is unable to find the jwks?
Hi @LIFE , I haven't been quite able to replicate this. What version of .NET are you targeting and what version of
Microsoft.AspNetCore.Authentication.JwtBearer
are you using?Thank you for the information, unfortunately I am not able to replicate the same issue.
In the default configuration a request will be made to the OpenID configuration endpoint and then following another request to the JWKS endpoint.
Outbound request tracing could be useful to see if the request are being made. Configuring JwtBearer there are also options
Backchannel
and BackchannelHttpHandler
that can be configured to interact with the outbound HTTP client.
You can inspect these endpoints in browser to confirm connectivity from your local machine:
- https://alkolas.kinde.com/.well-known/openid-configuration
- https://alkolas.kinde.com/.well-known/jwks
You mentioned it works in production, it might be worth doing a comparison of configuration between the two environments for any difference that may be causing issues.
It may also be worth starting a new project with just the essential code and see if it works in your local environment to try and isolate whether the issue relates to the local environment or that specific project.Actually, I just noticed in your project is
System.IdentityModel.Tokens.Jwt
version 7.5.2
, when I install this I can reproduce the problem. If I downgrade to 7.1.2
(which is referenced in Microsoft.AspNetCore.Authentication.JwtBearer
), it works again.
The only related reference I have been able to find is this: https://stackoverflow.com/a/78442187
I hope this helps.Stack Overflow
IDX10500: Signature validation failed. No security keys were provid...
I have the following code and when I call the api endpoint I get error Bearer was not authenticated. Failure message: IDX10500: Signature validation failed. No security keys were provided to valida...
Thank you! Yeah it was
Microsoft.AspNetCore.Authentication.JwtBearer
which was causing the issue. Sorry to drag you in this, automatically assumed it was a kinde related problem.
Really appreciate the help