# Retrieving 'identities' claim in id\_token on username/password login

**URL:** <https://community.auth0.com/t/retrieving-identities-claim-in-id-token-on-username-password-login/8410>\
**Category:** Get Help\
**Tags:** id\_token, claim, login\
**Created:** [October 6, 2017, 9:26pm UTC](https://community.auth0.com/t/retrieving-identities-claim-in-id-token-on-username-password-login/8410 "2017-10-06T21:26:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![auth-zero-dev](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@auth-zero-dev](https://community.auth0.com/u/auth-zero-dev)\
**Post date:** [October 6, 2017, 9:26pm UTC](https://community.auth0.com/t/retrieving-identities-claim-in-id-token-on-username-password-login/8410/1 "2017-10-06T21:26:38Z")

</div>

We have a google-based social login that requests ‘identities’ scope. As a result the id\_token JWT we get in response includes the following:

```
"identities": 
    {
      "provider": "google-oauth2",
      "user_id": "10902802101234569447",
      "connection": "google-oauth2",
      "isSocial": true
    }
  ],

```

However, we have a username/password login (using the auth0-js sdk .login method) that is requesting scope: “identities” but none are included in the response. Using other scopes like “openid” works correctly. Does anybody have any idea why this might be?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 9, 2017, 4:42pm UTC](https://community.auth0.com/t/retrieving-identities-claim-in-id-token-on-username-password-login/8410/2 "2017-10-09T16:42:42Z")

</div>

The `client.login` [method](https://auth0.com/docs/libraries/auth0js/v8#webauth-client-login-) in the latest Auth0.js uses the `/oauth/token` endpoint available as part of the latest authentication and authorization API feature set (aka this endpoint is not a legacy authentication endpoint and as such strictly conforms to OpenID Connect and OAuth2 specs).

When you consider the above with the fact that `identities` is not a standard OIDC scope then the behavior you’re obtaining is explained and expected. If you’re still using legacy authentication flows the recommendation would be to move to the new flows and stop relying in non-standard behavior like controlling the contents of the ID token using non-standard scopes.

With the [latest flows](https://auth0.com/docs/api-auth/intro) you can still add additional information to the ID token, you’ll just need to do it explicitly through a rule instead (see the [reference docs](https://auth0.com/docs/api-auth/tutorials/adoption/scope-custom-claims#custom-claims) for additional information).

If at this time, you cannot yet upgrade to the latest flows then you may need to constrain your usage solely to the legacy endpoints (this may mean using SDK version that are not latest and/or direct calls to the authentication API). In particular, you can also perform a username/password login in a similar manner to `/oauth/token` at `/oauth/ro` which is a legacy endpoint.

---

<div class="post-metadata">

**Author:** ![auth-zero-dev](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@auth-zero-dev](https://community.auth0.com/u/auth-zero-dev)\
**Post date:** [October 10, 2017, 9:35pm UTC](https://community.auth0.com/t/retrieving-identities-claim-in-id-token-on-username-password-login/8410/3 "2017-10-10T21:35:09Z")

</div>

Thanks for you response. I have added the rule that you suggested, and that works well. However, if I omit “scope” entirely from the .login() call options, the idToken still includes nonstandard properties I would expect from ‘profile’ scope - i.e. nickname, name, picture. If I do not include a scope on the social authentication I get none of those.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 11, 2017, 9:59pm UTC](https://community.auth0.com/t/retrieving-identities-claim-in-id-token-on-username-password-login/8410/4 "2017-10-11T21:59:03Z")

</div>

Can you update your question with the exact Auth0.js version being used, how you configure it and also the relevant calls for the social authentication and username/password scenarios? IIRC, if you don’t include scope in `/oauth/token` since this is a request that implies the user provided the actual password to your application then all OIDC standard information like `name` is returned because your application already has the user password so no worries in sharing that information by default. In other OIDC flows the application only receives the information it asked for through scope.

---

<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:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/retrieving-identities-claim-in-id-token-on-username-password-login/8410/5 "2018-03-02T05:56:51Z")

</div>


