# JWT token does not contain user profile data

**URL:** <https://community.auth0.com/t/jwt-token-does-not-contain-user-profile-data/46428>\
**Category:** Get Help\
**Tags:** jwt, api, auth0\
**Created:** [July 17, 2020, 1:42am UTC](https://community.auth0.com/t/jwt-token-does-not-contain-user-profile-data/46428 "2020-07-17T01:42:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevef](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stevef/32/22533_2.png) [@stevef](https://community.auth0.com/u/stevef)\
**Post date:** [July 17, 2020, 1:42am UTC](https://community.auth0.com/t/jwt-token-does-not-contain-user-profile-data/46428/1 "2020-07-17T01:42:01Z")

</div>

Hi,

I am attempting to work with the auth0-laravel-php-web-app to embed user profiles into my database. On my frontend, using React, I am able to retrieve a JWT token using the `useAuth0` hook.

`import { useAuth0 } from '@auth0/auth0-react';`

From there, I retrieve a token using `const token = await getAccessTokenSilently();` and use that as my Authorization Bearer token to communicate with a Laravel backend.

The problem is, when I decode this token, it does not contain the user profile. here’s the token decoded:

```
{
  "iss": "https://myapp-dev.us.auth0.com/",
  "sub": "google-oauth2|<some_id>",
  "aud": [
    "https://api.my-app-dev",
    "https://my-app-dev.us.auth0.com/userinfo"
  ],
  "iat": 1594945405,
  "exp": 1595031805,
  "azp": "rULZplrbcwdZgKRLEJcjCLc5anvu81RP",
  "scope": "openid profile email",
  "permissions": []
}

```

So when this gets decoded by the server, in my CustomUserProvider.php, the `$profile` is empty and I do not have an email or name.

```
 protected function upsertUser( $profile ) {  
        return User::firstOrCreate(['sub' => $profile['sub']], [
            'email' => $profile['email'] ?? '',
            'name' => $profile['name'] ?? '',
        ]);
    }

```

This code is taken from [https://github.com/auth0-samples/auth0-laravel-php-web-app/blob/master/01-Login/app/Repositories/CustomUserRepository.php#L20](https://github.com/auth0-samples/auth0-laravel-php-web-app/blob/master/01-Login/app/Repositories/CustomUserRepository.php#L20).

How do I get my JWT token to include name/email so I can work with it in my backend?

thanks 🙂

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [July 17, 2020, 2:03am UTC](https://community.auth0.com/t/jwt-token-does-not-contain-user-profile-data/46428/2 "2020-07-17T02:03:40Z")

</div>

You need to [create a Rule](https://auth0.com/docs/flows/guides/auth-code/includes/sample-use-cases-call-api#customize-tokens) that will add the profile data you want to your ID and / or access tokens.

---

<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:** [August 1, 2020, 2:03am UTC](https://community.auth0.com/t/jwt-token-does-not-contain-user-profile-data/46428/3 "2020-08-01T02:03:43Z")

</div>

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