# Okta as an IDP - Id token does not include given\_name, family\_name

**URL:** <https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858>\
**Category:** Questions\
**Created:** [November 23, 2020, 7:44am UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858 "2020-11-23T07:44:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lak](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Lak](https://devforum.okta.com/u/Lak)\
**Post date:** [November 23, 2020, 7:44am UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/1 "2020-11-23T07:44:48Z")

</div>

I am using Okta as an IDP and trying to receive given\_name and family\_name in id token. The request scope has set to ‘Profile’.

 ![request](https://global.discourse-cdn.com/oktadev/original/2X/5/5eb3b4288b1ac499cb7b49d7e4bdda0c6b5f2e32.jpeg)

Okta app settings below;  
 ![App Settings](https://global.discourse-cdn.com/oktadev/original/2X/f/fe392418c3c687faa66179e52cf600ed8a90ff7e.jpeg)

What am I missing here. Please help.

Thanks.  
Lak

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [November 23, 2020, 2:55pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/2 "2020-11-23T14:55:46Z")

</div>

Are you using a particular language or framework? Your scope parameter looks funny. I’d expect to see four different parameters and it looks like you only have two (because the 2nd part is concatenation together with plus signs).

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [November 23, 2020, 4:28pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/3 "2020-11-23T16:28:20Z")

</div>

Which OAuth flow are you using? Is it authorization code flow (with or without PKCE auth) or implicit flow where both the ID token and Access tokens are returned?

If so, you likely are looking at a “thin” ID token and you will need to send the access token to the /userinfo endpoint to see these missing claims. More details [here](https://support.okta.com/help/s/article/Okta-Groups-or-Attribute-Missing-from-Id-Token).

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [November 23, 2020, 7:28pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/4 "2020-11-23T19:28:50Z")

</div>

@Lak Hi,  
as @mraible mentioned, please try to use the correct scope format and see if any changes.

I see you add offline\_access to the scope, are you trying to get [refresh token](https://developer.okta.com/docs/guides/refresh-tokens/-/get-refresh-token/#get-a-refresh-token-with-the-code-flow)?

The response\_type is “code” currently and you should get a code return if everything set up correctly. You may need to [exchange the code for tokens](https://developer.okta.com/docs/guides/implement-auth-code/exchange-code-token/) then.

---

<div class="post-metadata">

**Author:** ![Lak](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Lak](https://devforum.okta.com/u/Lak)\
**Post date:** [November 23, 2020, 8:16pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/5 "2020-11-23T20:16:03Z")

</div>

Thanks @mraible and @Lijia. I am using Azure B2C custom policies and the screenshot is taken from Mozilla SAML tracer. Not sure its the standard but from SAML tracer the scope is shown in this way.

> scope : profile openid+email+offline\_access

Please disregard ‘offline\_access’ scope. Yes I was testing to see if I could get refresh token as well but its not my primary concern at the moment.

Below is how I call Okta IDP from Azure B2C Custom policies.

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/d/d0158f7edf3ae7e898618f091351b7821fa80331.png)

The ID token return name, and email but not given\_name and family\_name values.

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/a/a2310063a0c7675e6bbb45b2dabf8defd387878d.png)

---

<div class="post-metadata">

**Author:** ![Lak](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Lak](https://devforum.okta.com/u/Lak)\
**Post date:** [November 23, 2020, 8:33pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/6 "2020-11-23T20:33:28Z")

</div>

Thanks @andrea. I am using Okta as an IDP for SSO and use Azure B2C custom policies sociallogin flow to do it with openID authentication. So I guess I am only receiving ID token.

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/0/0e6fdf9d1daeabae15758e9d4c307d32b9be8fb8.png)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [November 23, 2020, 10:27pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/7 "2020-11-23T22:27:27Z")

</div>

Hmm… It looks like you are using authorization code flow (response\_type = code), which leads me to suspect my original hypothesis may be correct.

If there is no way to get the access token (so that you can make the call to userinfo), you _could_ create custom claims for the Default authorization server you are using.

When creating custom claims, you can decide that they will always be included (so even if you do get a ‘thin’ ID token, the claim will be present), instead of only being included in the ID token when using an OAuth flow requesting _only_ requesting the ID token (implicit flow, response\_type = id\_token, resulting in you receiving a ‘fat’ token).

 ![Screen Shot 2020-11-23 at 2.25.15 PM](https://global.discourse-cdn.com/oktadev/original/2X/0/0b61307fbd0fb918c766a601dd4828fb803b498d.png)

---

<div class="post-metadata">

**Author:** ![Lak](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Lak](https://devforum.okta.com/u/Lak)\
**Post date:** [November 23, 2020, 11:06pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/8 "2020-11-23T23:06:05Z")

</div>

> [@andrea](#):
>
> id\_token

Thanks for the reply @andrea.

I created a custom claim as advised and updated B2C custom policies accordingly but I still dont see the custom claim in id token. I can however see given\_name, family\_name, and appuser\_given\_name in token preview with grant type ‘implicity(hybrid)’. I can still see the custom claim appuser\_given\_name value when grant type set to ‘authorization code’.

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/b/b36044c0596a6af32792b569850c572923e34195.png)

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/3/36327646dbb3f6b22f917e601dbf9fdf3459fd4b.png)

Thanks again for your help. Much appreciated.

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [November 24, 2020, 12:29am UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/9 "2020-11-24T00:29:00Z")

</div>

@Lak With your attached screenshots, I doubt if you mapped the customized claims well in the profile or set up the claims syntax correctly. We probably needs more info from your side. In order to trouble shooting asap and save your time without back and forth comments. I suggest you open a support ticket through an email to [support@okta.com](mailto:support@okta.com) with this issue. One of our Developer Support Engineers will take the case and narrow down the cause of the issue. This is a common issue for Okta dev support team and it should be an easy to resolve once we do a sanity check for your configuration.

---

<div class="post-metadata">

**Author:** ![Lak](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Lak](https://devforum.okta.com/u/Lak)\
**Post date:** [November 24, 2020, 1:31am UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/10 "2020-11-24T01:31:26Z")

</div>

Thanks @Lijia. I have raised a support request ‘00998390’.

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [November 25, 2020, 7:57pm UTC](https://devforum.okta.com/t/okta-as-an-idp-id-token-does-not-include-given-name-family-name/11858/11 "2020-11-25T19:57:12Z")

</div>

Closed on November 25, 2020, 7:57pm UTC


