Auth0 Home Blog Docs

Get id_token in php app



Trying to get and decode the user’s id_token so I can get access to some data passed by a Rule:
context.idToken[namespace + 'access_token']. I’m using the PHP SDK:

$auth0 = new Auth0([
  'domain'        => getenv('AUTH0_DOMAIN'),
  'client_id' => getenv('AUTH0_CLIENT_ID'),
  'client_secret' => getenv('AUTH0_CLIENT_SECRET'),
  'redirect_uri'  => getenv('AUTH0_CALLBACK_URL'),
  'audience' => '',
  'scope' => 'profile openid email',
  'persist_id_token' => true,
  'persist_access_token' => true,
  'persist_refresh_token' => true

Although I did find this on decoding the JWT, I cannot find any documentation on how to get this token into my app using this SDK.



Found it $auth0->getIdToken();


Glad you got it figured out, thanks for checking back in!