# How can I request only some of profile information?

**URL:** <https://community.auth0.com/t/how-can-i-request-only-some-of-profile-information/115013>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [August 30, 2023, 9:43am UTC](https://community.auth0.com/t/how-can-i-request-only-some-of-profile-information/115013 "2023-08-30T09:43:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Szyszka947](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/szyszka947/32/50002_2.png) [@Szyszka947](https://community.auth0.com/u/Szyszka947)\
**Post date:** [August 30, 2023, 9:43am UTC](https://community.auth0.com/t/how-can-i-request-only-some-of-profile-information/115013/1 "2023-08-30T09:43:33Z")

</div>

Hi,  
I need only some of information that the _profile_ scope returns. I need only _picture_ and _nickname_. So I opened the _/.well-known/openid-configuration_ and see that scopes like _picture_ and other are supported. So I tried requesting _openid picture nickname_, and I got only _openid_. So I saw that _claims_ are supported. So I requested claims like it (value of _claims_ parameter in request):

```auto
{
   "id_token":{
      "nickname":{
         "essential":true
      },
      "picture":{
         "essential":true
      }
   }
}

```

and my _id\_token_ doesnt contain requested claims. So how can I request only some of claims that _profile_ scope provides?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [August 30, 2023, 6:10pm UTC](https://community.auth0.com/t/how-can-i-request-only-some-of-profile-information/115013/3 "2023-08-30T18:10:55Z")

</div>

Hi @Szyszka947,

Welcome to the Auth0 Community!

Unfortunately, the `picture` and `nickname` are not legitimate scopes that you can request.

When passing the `profile` scope in the request, you will get the claims that represent the basic profile information, which includes `name`, `family_name`, `given_name`, `middle_name`, `nickname`, `picture`, and `updated_at` claims.

See [OpenID Connect Scopes](https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes#standard-claims) for more details on the OIDC Scopes.

Now, if you **must** require only a subset of these claims, like only having `picture` and `nickname`, you will have to write a Post-Login Action to append them as custom claims.

For example:

```auto
exports.onExecutePostLogin = async (event, api) => {
  const namespace = 'https://myapp.example.com';
  if (event.authorization) {
    // Set claims in ID token
    api.idToken.setCustomClaim(`${namespace}/nickname`, event.user.nickname);
    api.idToken.setCustomClaim(`${namespace}/picture`, event.user.picture);
    
    // Set claims in access token
    api.accessToken.setCustomClaim(`${namespace}/nickname`, event.user.nickname);
    api.accessToken.setCustomClaim(`${namespace}/picture`, event.user.picture);
};

```

Thanks,  
Rueben

---

<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:** [September 13, 2023, 6:11pm UTC](https://community.auth0.com/t/how-can-i-request-only-some-of-profile-information/115013/4 "2023-09-13T18:11:40Z")

</div>

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