Auth0 Home Blog Docs

Error in authentication with JWT

Hi,

I have setup the following sample vue.js application: https://github.com/auth0-samples/auth0-vue-samples

It authenticates fine, but when I try to use the created JWT token to access the API I get the following error:

UnauthorizedError: error:0D0E20DD:asn1 encoding routines:c2i_ibuf:illegal padding

I have tried to replicate the setup, but I get the same error. Does anyone know what the error is?

2 Likes

Hi @n111 Welcome to Auth0 Community.

Could you clarify which token are you referring to? Is it id_token or access_token? Have you tried to inspect the token via jwt.io ? another thing to look into is how you are validating the token on backend? It might be related to the public key you are using per this similar issue on GH https://github.com/auth0/node-jsonwebtoken/issues/510#issuecomment-415026623

1 Like

Thank you.

I investigated the issue a lot and I think it was related to the public key. I tried to create a new Auth0 account and then it worked. Very strange.

3 Likes

Glad you have it working now!

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