Access_token is malformed jwt when authenticating with google-oauth2

Hi @rueben.tiow,

Thanks for your reply!

Unfortunately I don’t think this is the issue… If you send a request via axios.post with a query string as data it automatically sets the content-type header to application/x-www-form-urlencoded.

You can see it in the axios docs here. I confirmed this by sending the request to my own endpoint and checking the headers.

I tried setting the header explicitly as in your example code but I get the same result.

I also tried using curl with the same result

curl --request POST \
  --url 'https://***.eu.auth0.com/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'grant_type=authorization_code' \
  --data 'client_id=***' \
  --data 'client_secret=***' \
  --data 'code=***' \
  --data 'redirect_uri=http://localhost:3000/callback'

If you’ve got any other ideas they’d be much appreciated!

Cheers,

Matt

1 Like