Auth0 Home Blog Docs

idtoken null in web lock 11

jwt
auth0
idtoken
web-lock

#1

In my app, I embedded auth0 web lock for authentication. All seems to work fine, except that I can’t find the JWT (which I need to call my own api). Here’s what I get as return value from auth0 web lock:

{accessToken: "QhGObH6d-Xfmo5vh7Y_ln3OtYhy7lZsS",
 idToken: null, 
 idTokenPayload: null,
 appState: null, 
 refreshToken: null
}

I can use this to get the user profile, but I can’t(!) find the JWT… how or where is the token found in the result of the auth web lock (11)?


#2

I had the same issue, your auth0 options json object is probably not set correctly. Set it like this:

  auth0Options = {
    auth: {
      responseType: 'token id_token',
      audience: 'blah',
      redirectUri: 'blah',
      scope: 'openid',
    },
    autoclose: true,
    oidcConformant: true,
  };

  // Initializing our Auth0Lock
  lock = new Auth0Lock(
    'your clientId',
    'your domain',
    this.auth0Options
  );