mmmaxxx
December 15, 2022, 4:49pm
1
I’m trying to validate the access token I receive from my react native app in the backend using the Auth0 PHP package. But I keep getting the following error
Auth0\SDK\Exception\InvalidTokenException: The JWT string must contain two dots in Auth0\SDK\Exception\InvalidTokenException::badSeparators() (line 42 of /Users/USER/Sites/APPNAME/vendor/auth0/auth0-php/src/Exception/InvalidTokenException.php).
But checking the token I’m sending, it does contain 2 dots, here is what I’ve done in the backend:
Is there anything I’m doing wrong?
Thanks
Hi @mmmaxxx ,
Welcome to the Auth0 Community!
Could you provide an example token you are seeing? Have you tried decoding it with JWT.io ?
mmmaxxx
December 15, 2022, 8:41pm
4
Hi Dan
Here is an access token:
eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9kZXYtazFreTF1OGd4aXRndTdqcy51cy5hdXRoMC5jb20vIn0..J-lwvtJENQqaGaIu.XBOufABotm_we9vhPzaSm9TPrU9tfQAfJ3Sqpheif0gTLpR2Q8rSjf6t0TSQ3jl_OlYmVJ8UvcLO0mJZz9KbGdfzJPqqXc5YdbKgwX8kHF5DqB5ld7gwe24V4YaItaEH00cI-oKG5T9P69bTTmg4UZBAlx_A7-B5knnFBi5CoKWH34zAkNhKjwaOVare_kislgZg-yXGijSI82Hf4hGBvmFJqyo6a5-FF1Bjq-s0hcWszdL6QYGSz0kNCrMnjAfpE8q9wNXnwNNfXLgLY8M2d7Ii1NHtIlM7L4oZ9V-MFuaBtqPJe6oitjrZMWbR8AxFjVae8r2fGtTiw596kanYkNaMxhhIKgRgdjDOxOfPE_9EyGtB0lG9y9mL1m-cqn2GB3aNoQ.7AP6u3CszXy4E4qEN17zvg
I’ve tried decoding it with JWT.io but without success
@mmmaxxx ,
That appears to be an opaque token. You will need to request a JWT. Here’s an FAQ about it:
Question: Why is my access token not a JWT? (Opaque Token)
Answer:
An access token will be issued in one of the following formats:
JSON Web Token (JWT) : Tokens that conform to the JSON Web Token standard and contain information about an entity in the form of claims. They are self-contained in that it is not necessary for the recipient to call a server to validate the token. Access Tokens issued for the Auth0 Management API and Access Tokens issued for any custom API that you have registere…
system
Closed
January 30, 2023, 9:40pm
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.