How to solve "Decryption failed. No Keys tried" error calling ValidateToken

I could use a hand validating an Auth0 JWT from a .Net8 console app.

I’ve gone through numerous examples and searches, but can only get calls to SecurityToken.ValidateToken to throw an exception, complaining that “Decryption failed. No Keys tried”

Attaching screen shots of my Client TypeScript code, and my .Net8 code in my sample API endpoint.

Any help or insight would be appreciated.

Client code to get the Token from Auth0:

Server code to validate it. The token itself shows up here looking just like it does on the client’s end before sending it to the server. The server seems to receive the Token just fine, as delivered in an HTTP Header. The last line throws the aforementioned error:

Hi @bill.rebey

Thank you for posting your question on the Auth0 Community!

Please take a look at this community post. As mentioned in there, when you are making a request to your /authorize endpoint, you might not be passing in audience parameter and you are receiving an opaque token which cannot be validated.

You can try to decode the current access token that your code receives on jwt.io to see if it is by any chance malformed.

Alternatively, as mentioned in our documentation about Validating JTWs, you can attempt to validate the token by using Auth0’s Middleware or using a 3rd party library from jwt.io.

If you have any other question on the matter, feel free to leave a reply!

Kind Regards,
Nik

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.