Auth0 Home Blog Docs

How to get an access token and an id token from the same authentication event

I’m using the following code to hit the authorize endpoint:

const authUrl = `${auth0Domain}/authorize?` + queryString.stringify({
      client_id: auth0ClientId,
      response_type: 'token',
      redirect_uri: redirectUrl,
      scope: 'openid',
      audience: audience
});

The response type is token, I tried setting it to ‘token id_token’ but when I do that and go to the lock screen, it says ‘oops something went wrong’ and the logs on my account show ‘failed login - missing required param nonce’. Is there a way to get both access token and id token in the same response? I dont want to have to hit the /userinfo endpoint after authenticating if I can avoid it

Do you just need to add a nonce?

1 Like

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