|
| 1 | +--- |
| 2 | +title: User profile attributes in Azure Active Directory B2C |
| 3 | +description: Learn about the user resource type attributes that are supported by the Azure AD B2C directory user profile. Find out about built-in attributes, extensions, and how attributes map to Microsoft Graph. |
| 4 | +services: active-directory-b2c |
| 5 | +author: msmimart |
| 6 | +manager: celestedg |
| 7 | + |
| 8 | +ms.service: active-directory |
| 9 | +ms.workload: identity |
| 10 | +ms.topic: conceptual |
| 11 | +ms.date: 3/11/2020 |
| 12 | +ms.author: mimart |
| 13 | +ms.subservice: B2C |
| 14 | +--- |
| 15 | + |
| 16 | +# User profile attributes |
| 17 | + |
| 18 | +Your Azure Active Directory (Azure AD) B2C directory user profile comes with a built-in set of attributes, such as given name, surname, city, postal code, and phone number. You can extend the user profile with your own application data without requiring an external data store. Most of the attributes that can be used with Azure AD B2C user profiles are also supported by Microsoft Graph. This article describes supported Azure AD B2C user profile attributes. It also notes those attributes that are not supported by Microsoft Graph, as well as Microsoft Graph attributes that should not be used with Azure AD B2C. |
| 19 | + |
| 20 | +> [!IMPORTANT] |
| 21 | +> You should not use built-in or extension attributes to store sensitive personal data, such as account credentials, government identification numbers, cardholder data, financial account data, healthcare information, or sensitive background information. |
| 22 | +
|
| 23 | +You can also integrate with external systems. For example, you can use Azure AD B2C for authentication, but delegate to an external customer relationship management (CRM) or customer loyalty database as the authoritative source of customer data. For more information, see the [remote profile](https://github.com/azure-ad-b2c/samples/tree/master/policies/remote-profile) solution. |
| 24 | + |
| 25 | +The table below lists the [user resource type](https://docs.microsoft.com/graph/api/resources/user) attributes that are supported by the Azure AD B2C directory user profile. It gives the following information about each attribute: |
| 26 | + |
| 27 | +- Attribute name used by Azure AD B2C (followed by the Microsoft Graph name in parentheses, if different) |
| 28 | +- Attribute data type |
| 29 | +- Attribute description |
| 30 | +- If the attribute is available in the Azure portal |
| 31 | +- If the attribute can be used in a user flow |
| 32 | +- If the attribute can be used in a custom policy [Azure AD technical profile](active-directory-technical-profile.md) and in which section (<InputClaims>, <OutputClaims>, or <PersistedClaims>) |
| 33 | + |
| 34 | +|Name |Type |Description|Azure portal|User flows|Custom policy| |
| 35 | +|---------|---------|----------|------------|----------|-------------| |
| 36 | +|accountEnabled |Boolean|Whether the user account is enabled or disabled: **true** if the account is enabled, otherwise **false**.|Yes|No|Persisted, Output| |
| 37 | +|ageGroup |String|The user’s age group. Possible values: null, Undefined, Minor, Adult, NotAdult.|Yes|No|Persisted, Output| |
| 38 | +|alternativeSecurityId|String|A single user identity from the external identity provider.|No|No|Input, Persisted, Output| |
| 39 | +|alternativeSecurityIds|alternative securityId collection|A collection of user identities from external identity providers.|No|No|Persisted, Output| |
| 40 | +|city |String|The city in which the user is located. Max length 128.|Yes|Yes|Persisted, Output| |
| 41 | +|consentProvidedForMinor|String|Whether the consent has been provided for a minor. Allowed values: null, granted, denied, or notRequired.|Yes|No|Persisted, Output| |
| 42 | +|country |String|The country/region in which the user is located. Example: “US” or “UK”. Max length 128.|Yes|Yes|Persisted, Output| |
| 43 | +|createdDateTime|DateTime|The date the user object was created. Read only.|No|No|Persisted, Output| |
| 44 | +|creationType |String|If the user account was created as a local account for an Azure Active Directory B2C tenant, the value is LocalAccount or nameCoexistence. Read only.|No|No|Persisted, Output| |
| 45 | +|dateOfBirth |Date|Date of birth.|No|No|Persisted, Output| |
| 46 | +|department |String|The name for the department in which the user works. Max length 64.|Yes|No|Persisted, Output| |
| 47 | +|displayName |String|The display name for the user. Max length 256.|Yes|Yes|Persisted, Output| |
| 48 | +|facsimileTelephoneNumber<sup>1</sup>|String|The telephone number of the user's business fax machine.|Yes|No|Persisted, Output| |
| 49 | +|givenName |String|The given name (first name) of the user. Max length 64.|Yes|Yes|Persisted, Output| |
| 50 | +|jobTitle |String|The user's job title. Max length 128.|Yes|Yes|Persisted, Output| |
| 51 | +|immutableId |String|An identifier which is typically used for users migrated from on-premises Active Directory.|No|No|Persisted, Output| |
| 52 | +|legalAgeGroupClassification|String|Legal age group classification. Read-only and calculated based on ageGroup and consentProvidedForMinor properties. Allowed values: null, minorWithOutParentalConsent, minorWithParentalConsent, minorNoParentalConsentRequired, notAdult and adult.|Yes|No|Persisted, Output| |
| 53 | +|legalCountry<sup>1</sup> |String|Country for legal purposes.|No|No|Persisted, Output| |
| 54 | +|mail |String |The SMTP address for the user, for example, " [email protected]". Read-only. |No |No |Persisted, Output | |
| 55 | +|mailNickName |String|The mail alias for the user. Max length 64.|No|No|Persisted, Output| |
| 56 | +|mobile (mobilePhone) |String|The primary cellular telephone number for the user. Max length 64.|Yes|No|Persisted, Output| |
| 57 | +|netId |String|Net ID.|No|No|Persisted, Output| |
| 58 | +|objectId |String|A globally unique identifier (GUID) that is the unique identifier for the user. Example: 12345678-9abc-def0-1234-56789abcde. Read only, Immutable.|Read only|Yes|Input, Persisted, Output| |
| 59 | +|otherMails |String collection |A list of additional email addresses for the user. Example: [" [email protected]", " [email protected]" ]. |Yes (Alternate email) |No |Persisted, Output | |
| 60 | +|password |String|The password for the local account during user creation.|No|No|Persisted| |
| 61 | +|passwordPolicies |String|Policy of the password. It's a string consisting of different policy name separated by comma. i.e. "DisablePasswordExpiration, DisableStrongPassword".|No|No|Persisted, Output| |
| 62 | +|physicalDeliveryOfficeName (officeLocation)|String|The office location in the user's place of business. Max length 128.|Yes|No|Persisted, Output| |
| 63 | +|postalCode |String|The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code. Max length 40.|Yes|No|Persisted, Output| |
| 64 | +|preferredLanguage |String|The preferred language for the user. Should follow ISO 639-1 Code. Example: "en-US".|No|No|Persisted, Output| |
| 65 | +|refreshTokensValidFromDateTime|DateTime|Any refresh tokens issued before this time are invalid, and applications will get an error when using an invalid refresh token to acquire a new access token. If this happens, the application will need to acquire a new refresh token by making a request to the authorize endpoint. Read-only.|No|No|Output| |
| 66 | +|signInNames |String|The unique sign-in name of the local account user of any type in the directory. Use this to get a user with sign-in value without specifying the local account type.|No|No|Input| |
| 67 | +|signInNames.userName |String|The unique username of the local account user in the directory. Use this to create or get a user with a specific sign-in username. Specifying this in PersistedClaims alone during Patch operation will remove other types of signInNames. If you would like to add a new type of signInNames, you also need to persist existing signInNames.|No|No|Input, Persisted, Output| |
| 68 | +|signInNames.phoneNumber |String|The unique phone number of the local account user in the directory. Use this to create or get a user with a specific sign-in phone number. Specifying this in PersistedClaims alone during Patch operation will remove other types of signInNames. If you would like to add a new type of signInNames, you also need to persist existing signInNames.|No|No|Input, Persisted, Output| |
| 69 | +|signInNames.emailAddress |String|The unique email address of the local account user in the directory. Use this to create or get a user with a specific sign-in email address. Specifying this in PersistedClaims alone during Patch operation will remove other types of signInNames. If you would like to add a new type of signInNames, you also need to persist existing signInNames.|No|No|Input, Persisted, Output| |
| 70 | +|state |String|The state or province in the user's address. Max length 128.|Yes|Yes|Persisted, Output| |
| 71 | +|streetAddress |String|The street address of the user's place of business. Max length 1024.|Yes|Yes|Persisted, Output| |
| 72 | +|strongAuthentication AlternativePhoneNumber<sup>1</sup>|String|The secondary telephone number of the user, used for multi-factor authentication.|Yes|No|Persisted, Output| |
| 73 | +|strongAuthenticationEmailAddress< sup>1</ sup> |String |The SMTP address for the user. Example: " [email protected]" This attribute is used for sign-in with username policy, to store the user email address. The email address then used in a password reset flow. |Yes |No |Persisted, Output | |
| 74 | +|strongAuthenticationPhoneNumber<sup>1</sup>|String|The primary telephone number of the user, used for multi-factor authentication.|Yes|No|Persisted, Output| |
| 75 | +|surname |String|The user's surname (family name or last name). Max length 64.|Yes|Yes|Persisted, Output| |
| 76 | +|telephoneNumber (first entry of businessPhones)|String|The primary telephone number of the user's place of business.|Yes|No|Persisted, Output| |
| 77 | +|userPrincipalName |String|The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. The domain must be present in the tenant's collection of verified domains. This property is required when an account is created. Immutable.|No|No|Input, Persisted, Output| |
| 78 | +|usageLocation |String|Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Not nullable. A two letter country code (ISO standard 3166). Examples: "US", "JP", and "GB".|Yes|No|Persisted, Output| |
| 79 | +|userType |String|A string value that can be used to classify user types in your directory. Value must be Member. Read-only.|Read only|No|Persisted, Output| |
| 80 | +|userState (externalUserState)<sup>2</sup>|String|For Azure AD B2B account only, indicates whether the invitation is PendingAcceptance or Accepted.|No|No|Persisted, Output| |
| 81 | +|userStateChangedOn (externalUserStateChangeDateTime)<sup>2</sup>|DateTime|Shows the timestamp for the latest change to the UserState property.|No|No|Persisted, Output| |
| 82 | +|<sup>1 </sup>Not supported by Microsoft Graph<br><sup>2 </sup>Should not be used with Azure AD B2C|||||| |
| 83 | + |
| 84 | + |
| 85 | +## Extension attributes |
| 86 | + |
| 87 | +You’ll often need to create your own attributes, as in the following cases: |
| 88 | + |
| 89 | +- A customer-facing application needs to persist for an attribute like **LoyaltyNumber**. |
| 90 | +- An identity provider has a unique user identifier like **uniqueUserGUID** that must be saved. |
| 91 | +- A custom user journey needs to persist for a state of a user, like **migrationStatus**. |
| 92 | + |
| 93 | +Azure AD B2C extends the set of attributes stored on each user account. Extension attributes [extend the schema](https://docs.microsoft.com/graph/extensibility-overview#schema-extensions) of the user objects in the directory. The extension attributes can only be registered on an application object, even though they might contain data for a user. The extension attribute is attached to the application called b2c-extensions-app. Do not modify this application, as it's used by Azure AD B2C for storing user data. You can find this application under Azure Active Directory App registrations. |
| 94 | + |
| 95 | +> [!NOTE] |
| 96 | +> - Up to 100 extension attributes can be written to any user account. |
| 97 | +> - If the b2c-extensions-app application is deleted, those extension attributes are removed from all users along with any data they contain. |
| 98 | +> - If an extension attribute is deleted by the application, it's removed from all user accounts and the values are deleted. |
| 99 | +> - The underlying name of the extension attribute is generated in the format "Extension_" + Application ID + "_" + Attribute name. For example, if you create an extension attribute LoyaltyNumber, and the b2c-extensions-app Application ID is 831374b3-bd50-41bf-aa54-263ec9e050fc, the underlying extension attribute name will be: extension_831374b3bd5041bfaa54263ec9e050fc_LoyaltyNumber. You use the underlying name when you run Graph API queries to create or update user accounts. |
| 100 | +
|
| 101 | +The following data types are supported when defining a property in a schema extension: |
| 102 | + |
| 103 | +|Property type |Remarks | |
| 104 | +|--------------|---------| |
| 105 | +|Boolean | Possible values: **true** or **false**. | |
| 106 | +|DateTime | Must be specified in ISO 8601 format. Will be stored in UTC. | |
| 107 | +|Integer | 32-bit value. | |
| 108 | +|String | 256 characters maximum. | |
| 109 | + |
| 110 | +## Next steps |
| 111 | +Learn more about extension attributes: |
| 112 | +- [Schema extensions](https://docs.microsoft.com/graph/extensibility-overview#schema-extensions) |
| 113 | +- [Define custom attributes with user flow](user-flow-custom-attributes.md) |
| 114 | +- [Define custom attributes with custom policy](custom-policy-custom-attributes.md) |
0 commit comments