Optional_claim tenany_ctry in AAD token

KAMALPREET KAUR 1 Reputation point Microsoft Employee
2022-06-28T04:26:12.097+00:00

our team needs the tenant_ctry field for users to enable our feature only for limited countries. we want to make sure that tenant_ctry claim is reliable source for country of tenant? and this field will never be null.
2. what is the source of these optional claims - ctry , tenant_ctry?
3. Also will it always represent 2 letter code of a country? it won't be a region like NA- north america

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,146 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 30,296 Reputation points Microsoft Employee
    2022-06-29T06:41:49.133+00:00

    Hi @KAMALPREET KAUR ,

    Thanks for reaching out.

    I understand you are looking to add optional claims ctry and tenant_ctry in your Azure AD application to get the value in token.

    what is the source of these optional claims - ctry , tenant_ctry?

    ctry claim - You can add the optional claim ctry to get the country of the user who logged in to your application. This value will come in the ID token which contains claims about the user. This value needs to be added while adding the user in Azure AD. If this value is null, optional claim ctry will not reflect in the token.

    tenant_ctry - This is the value of country, set while creating the tenant. This value will retrieve the country of the tenant where your application is registered.

    Also will it always represent 2 letter code of a country? it won't be a region like NA- north america

    Yes, these values need to be present as standard two-letter country/region code only to retrieve in optional claims. i.e IN, US, NA

    User's Information added:

    215928-image.png

    Optional claim ctry value in ID token:

    215917-image.png

    Hope this will help.

    Thanks,
    Shweta

    -------------------

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.