How to get bearer token from auth0 instance? [Javascript]

Hello, when calling from vanilla JS single app:
auth0.getTokenSilently();
I get:
Promise {<fulfilled>: "a2So9B7mRWedK-exEExWr41fDkGJfa76"}

What type token is this? How to get bearer token from auth0 instance?

Hi @CodingLukas,

Welcome to the Community!

That looks like an opaque token, meaning it is one that cannot be decoded. If you are looking for a JWT Access Token to use with your own API, you will need to register your API and use its API identifier as the audience in the Auth0Client config:

  auth0 = await createAuth0Client({
    domain: config.domain,
    client_id: config.clientId,
    audience: config.apiIdentifier
  });

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