I’m currently developing a React Single Page Application (SPA) that uses Auth0 for authentication. I have successfully implemented login and logout features. However, when request an Authorization JWT with getTokenSilently() I am retrieving have an empty payload when decoded. For now I’m just logging it to my browsers console in a local test environment. For example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9kZXYtdzAxODFhcXNobGw1MDMzbC51cy5hdXRoMC5jb20vIn0…thF3uZU-GjTkcNVo.EQawZb4Ebgww3ZT-Pa73eoJ62qLQ0HSIswroGiecQZHGdZLw-953s6asccnawPD9HwSObZ3JcsbP8HAFarNf2p5Zrr2sbp4QvGxfB6RgpWZTxEK2Tntu7X7w9i_7z2Iw8c_3lUZPnHe0_4OLaHnPyetzk8_Pqm2-JcELrNIwvRPTD1QmdMsbyvz6_u9kANS181FH7wSyxtt5UP5Hu_BnQ3lmEQhB5yMvL42PjaAsoaclxEdQ0EQmcCRdnNrQVqnKadZumwvs2jQ-A-onQI9lL3rhlPEktJP8Sy-UyhRv-U_Az6MmY4D92-VRD_AjXhXLggV7iXMS8hZM9N_cDDCA5skg.Fuf3LqTHjNuCZj_fS8P8HQ
Technology Stack: ReactJS with Auth0 SPA SDK
Auth0 SDK Version: @auth0/auth0-react": “^2.1.0”,
Browser: Tried on multiple browsers including Chrome and Safari, and also in Incognito mode Error Messages: None
Steps to Reproduce:
User logs in via Auth0.
React App retrieves the token.
React App writes writes the token to console for debugging purposes.
What I have Tried:
Logged in and out multiple times, also in incognito mode in case of cacheing.
Checked Auth0 Dashboard logs for any signs of errors or irregularities.
Ensured that the Auth0Client object is initialized with an audience, which is an API that I crated in the Auth0 Dashboard. Reviewed and followed Auth0 SPA SDK documentation - though I am a beginner and most likely have something configured wrong.