# Get id\_token in php app

**URL:** <https://community.auth0.com/t/get-id-token-in-php-app/14016>\
**Category:** Get Help\
**Tags:** php, auth0\
**Created:** [August 6, 2018, 8:02pm UTC](https://community.auth0.com/t/get-id-token-in-php-app/14016 "2018-08-06T20:02:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Smith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ben_smith/32/6235_2.png) [@Ben\_Smith](https://community.auth0.com/u/Ben_Smith)\
**Post date:** [August 6, 2018, 8:02pm UTC](https://community.auth0.com/t/get-id-token-in-php-app/14016/1 "2018-08-06T20:02:05Z")

</div>

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' => 'https://ultrasoundjelly.auth0.com/userinfo',
  'scope' => 'profile openid email',
  'persist_id_token' => true,
  'persist_access_token' => true,
  'persist_refresh_token' => true
]);

```

Although I did find [this](https://github.com/auth0/auth0-PHP#usage---decoding-and-verifying-jwts) on decoding the JWT, I cannot find any documentation on how to get this token into my app using this SDK.

Thanks

---

<div class="post-metadata">

**Author:** ![Ben\_Smith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ben_smith/32/6235_2.png) [@Ben\_Smith](https://community.auth0.com/u/Ben_Smith)\
**Post date:** [August 7, 2018, 1:15am UTC](https://community.auth0.com/t/get-id-token-in-php-app/14016/2 "2018-08-07T01:15:23Z")

</div>

Found it `$auth0->getIdToken()`;

---

<div class="post-metadata">

**Author:** ![josh.cunningham](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/josh.cunningham/32/16289_2.png) [@josh.cunningham](https://community.auth0.com/u/josh.cunningham)\
**Post date:** [August 7, 2018, 3:29am UTC](https://community.auth0.com/t/get-id-token-in-php-app/14016/3 "2018-08-07T03:29:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 26, 2019, 8:59am UTC](https://community.auth0.com/t/get-id-token-in-php-app/14016/4 "2019-07-26T08:59:33Z")

</div>

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