# Json from Active Directory, not everything in claims

**URL:** <https://community.auth0.com/t/json-from-active-directory-not-everything-in-claims/86524>\
**Category:** Get Help\
**Tags:** active-directory, claims\
**Created:** [July 6, 2022, 12:34pm UTC](https://community.auth0.com/t/json-from-active-directory-not-everything-in-claims/86524 "2022-07-06T12:34:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mab](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mab/32/38495_2.png) [@mab](https://community.auth0.com/u/mab)\
**Post date:** [July 6, 2022, 12:34pm UTC](https://community.auth0.com/t/json-from-active-directory-not-everything-in-claims/86524/1 "2022-07-06T12:34:49Z")

</div>

Hi, I have a connection with the active directory. Auth0 gets some JSON with data from AD, for example

```auto
{
    "created_at": "2022-07-04T06:07:29.088Z",
    "email": "mas@test.com",
    "name": "Martin Sas (MAS)",
    "nickname": "mas",
    "user_id": "tzzd|SGW_66666666666666666666",
    "user_secret_login": "masXX@test.com"
}

```

When I try to read claims I don’t have type and value  
`"user_secret_login": "masXX@test.com"`

I try to make some custom action

```auto
exports.onExecutePostLogin = async (event, api) => {
  const namespace = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims';

  api.idToken.setCustomClaim(`${namespace}/user_secret_login`, event.user.user_secret_login);
};

```

But the event user doesn’t have user\_secret\_login… . How Can I get this value?

---

<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:** [July 6, 2022, 7:39pm UTC](https://community.auth0.com/t/json-from-active-directory-not-everything-in-claims/86524/3 "2022-07-06T19:39:06Z")

</div>

Hi @mab,

Thanks for reaching out to the Auth0 Community!

I understand that you are trying to set the `"user_secret_login"` attribute as a custom claim to your ID Token.

Unfortunately, accessing Top-Level IdP User Attributes is not possible at this time when using Actions. This [FAQ](https://community.auth0.com/t/how-to-access-user-groups-in-actions/84498) explains it in further detail.

In this situation, I recommend using Auth0 Rules to get the `"user_secret_login"` attribute. For example:

```auto
function(user, context, callback) {
  const namespace = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims';

  // add custom claims to ID Token
  let idTokenClaims = context.idToken || {};
  idTokenClaims[`${namespace}/user_secret_login`] = user.user_sercret_login;

  callback(null, user, context);
}

```

I hope this helps!

Please let me know how this works for you.

Thank you.

---

<div class="post-metadata">

**Author:** ![mab](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mab/32/38495_2.png) [@mab](https://community.auth0.com/u/mab)\
**Post date:** [July 7, 2022, 6:12am UTC](https://community.auth0.com/t/json-from-active-directory-not-everything-in-claims/86524/4 "2022-07-07T06:12:05Z")

</div>

Thanks. It works good 🙂

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 21, 2022, 5:12pm UTC](https://community.auth0.com/t/json-from-active-directory-not-everything-in-claims/86524/5 "2022-12-21T17:12:01Z")

</div>


