Skip to content

Commit ae729ad

Browse files
authored
Merge pull request #207056 from FaithOmbongi/20220805-minorFixes
Add extensions updates to B2C
2 parents 85621c7 + 0f1dbe0 commit ae729ad

File tree

3 files changed

+59
-31
lines changed

3 files changed

+59
-31
lines changed

articles/active-directory-b2c/extensions-app.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,33 @@ To verify that the b2c-extensions-app is present:
3131

3232
## Recover the extensions app
3333

34-
If you accidentally deleted the b2c-extensions-app, you have 30 days to recover it. You can restore the app using the Graph API:
34+
If you accidentally deleted the `b2c-extensions-app`, you have 30 days to recover it.
3535

36+
> [!NOTE]
37+
> An application can only be restored if it has been deleted within the last 30 days. If it has been more than 30 days, data will be permanently lost. For more assistance, file a support ticket.
38+
39+
### Recover the extensions app using the Azure portal
40+
41+
1. Sign in to your Azure AD B2C tenant.
42+
2. Search for and open **App registrations**.
43+
1. Select the **Deleted applications** tab and identify the `b2c-extensions-app` from the list of recently deleted applications.
44+
1. Select **Restore app registration**.
45+
46+
You should now be able to [see the restored app](#verifying-that-the-extensions-app-is-present) in the Azure portal.
47+
48+
### Recover the extensions app using Microsoft Graph
49+
To restore the app using Microsoft Graph, you must restore both the application and the service principal.
50+
51+
To restore the application:
3652
1. Browse to [https://developer.microsoft.com/en-us/graph/graph-explorer](https://developer.microsoft.com/en-us/graph/graph-explorer).
3753
1. Log in to the site as a global administrator for the Azure AD B2C directory that you want to restore the deleted app for. This global administrator must have an email address similar to the following: `username@{yourTenant}.onmicrosoft.com`.
38-
1. Issue an HTTP GET against the URL `https://graph.microsoft.com/beta/directory/deleteditems/microsoft.graph.application`. This operation will list all of the applications that have been deleted within the past 30 days.
39-
1. Find the application in the list where the name begins with 'b2c-extensions-app and copy its `objectid` property value.
40-
1. Issue an HTTP POST against the URL `https://graph.microsoft.com/beta/directory/deleteditems/{id}/restore`. Replace the `{id}` portion of the URL with the `objectid` from the previous step.
54+
1. Issue an HTTP GET against the URL `https://graph.microsoft.com/v1.0/directory/deleteditems/microsoft.graph.application`. This operation will list all of the applications that have been deleted within the past 30 days. You can also use the URL `https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.application?$filter=displayName eq 'b2c-extensions-app. Do not modify. Used by AADB2C for storing user data.'` to filter by the app's **displayName** property.
55+
1. Find the application in the list where the name begins with `b2c-extensions-app` and copy its `id` property value.
56+
1. Issue an HTTP POST against the URL `https://graph.microsoft.com/v1.0/directory/deleteditems/{id}/restore`. Replace the `{id}` portion of the URL with the `id` from the previous step.]
4157

42-
You should now be able to [see the restored app](#verifying-that-the-extensions-app-is-present) in the Azure portal.
58+
To restore the service principal:
59+
1. Issue an HTTP GET against the URL `https://graph.microsoft.com/v1.0/directory/deleteditems/microsoft.graph.servicePrincipal`. This operation will list all of the service principals that have been deleted within the past 30 days. You can also use the URL `https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.servicePrincipal?$filter=displayName eq 'b2c-extensions-app. Do not modify. Used by AADB2C for storing user data.'` to filter by the app's **displayName** property.
60+
1. Find the service principal in the list where the name begins with `b2c-extensions-app` and copy its `id` property value.
61+
1. Issue an HTTP POST against the URL `https://graph.microsoft.com/v1.0/directory/deleteditems/{id}/restore`. Replace the `{id}` portion of the URL with the `id` from the previous step.
4362

44-
> [!NOTE]
45-
> An application can only be restored if it has been deleted within the last 30 days. If it has been more than 30 days, data will be permanently lost. For more assistance, file a support ticket.
63+
You should now be able to [see the restored app](#verifying-that-the-extensions-app-is-present) in the Azure portal.

articles/active-directory-b2c/microsoft-graph-operations.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,25 @@ The top-level resource for policy keys in the Microsoft Graph API is the [Truste
141141
- [Create oauth2Permission Grant](/graph/api/resources/oauth2permissiongrant)
142142
- [Delete application](/graph/api/application-delete)
143143

144-
## Application extension properties
144+
## Application extension (directory extension) properties
145145

146-
- [Create extension properties](/graph/api/application-post-extensionproperty)
147-
- [List extension properties](/graph/api/application-list-extensionproperty)
148-
- [Get an extension property](/graph/api/extensionproperty-get)
149-
- [Delete extension property](/graph/api/extensionproperty-delete)
150-
- [Get available extension properties](/graph/api/directoryobject-getavailableextensionproperties)
146+
Application extension properties are also known as directory or Azure AD extensions. To manage them in Azure AD B2C, use the [identityUserFlowAttribute resource type](/graph/api/resources/identityuserflowattribute) and its associated methods.
151147

152-
<!--
153-
#Hiding this note because user flows and extension attributes are different things in Microsoft Graph.
148+
- [Create user flow attribute](/graph/api/identityuserflowattribute-post)
149+
- [List user flow attributes](/graph/api/identityuserflowattribute-list)
150+
- [Get a user flow attribute](/graph/api/identityuserflowattribute-get)
151+
- [Update a user flow attribute](/graph/api/identityuserflowattribute-update)
152+
- [Delete a user flow attribute](/graph/api/identityuserflowattribute-delete)
154153

155-
Azure AD B2C provides a directory that can hold 100 custom attributes per user. For user flows, these extension properties are [managed by using the Azure portal](user-flow-custom-attributes.md). For custom policies, Azure AD B2C creates the property for you, the first time the policy writes a value to the extension property.
156-
-->
154+
You can store up to 100 directory extension values per user. To manage the directory extension properties for a user, use the following [User APIs](/graph/api/resources/user) in Microsoft Graph.
157155

158-
Azure AD B2C provides a directory that can hold 100 extension values per user. To manage the extension values for a user, use the following [User APIs](/graph/api/resources/user) in Microsoft Graph.
156+
- [Update user](/graph/api/user-update): To write or remove the value of the directory extension property from the user object.
157+
- [Get a user](/graph/api/user-get): To retrieve the value of the directory extension for the user. The property will be returned by default through the `beta` endpoint, but only on `$select` through the `v1.0` endpoint.
159158

160-
- [Update user](/graph/api/user-update): To write or remove the extension property value from the user.
161-
- [Get a user](/graph/api/user-get): To retrieve the extension property value for the user. The extension property will be returned by default through the `beta` endpoint, but only on `$select` through the `v1.0` endpoint.
159+
For user flows, these extension properties are [managed by using the Azure portal](user-flow-custom-attributes.md). For custom policies, Azure AD B2C creates the property for you, the first time the policy writes a value to the extension property.
160+
161+
> [!NOTE]
162+
> In Azure AD, directory extensions are managed through the [extensionProperty resource type](/graph/api/resources/extensionproperty) and its associated methods. However, because they are used in B2C through the `b2c-extensions-app` app which should not be updated, they are managed in Azure AD B2C using the [identityUserFlowAttribute resource type](/graph/api/resources/identityuserflowattribute) and its associated methods.
162163
163164
## Audit logs
164165

@@ -174,6 +175,15 @@ For more information about accessing Azure AD B2C audit logs, see [Accessing Azu
174175
- [Update a Conditional Access policy](/graph/api/conditionalaccesspolicy-update)
175176
- [Delete a Conditional Access policy](/graph/api/conditionalaccesspolicy-delete)
176177

178+
## Retrieve or restore deleted users and applications
179+
180+
Deleted items can only be restored if they were deleted within the last 30 days.
181+
182+
- [List deleted items](/graph/api/directory-deleteditems-list)
183+
- [Get a deleted item](/graph/api/directory-deleteditems-get)
184+
- [Restore a deleted item](/graph/api/directory-deleteditems-restore)
185+
- [Permanently delete a deleted item](/graph/api/directory-deleteditems-delete)
186+
177187
## How to programmatically manage Microsoft Graph
178188

179189
When you want to manage Microsoft Graph, you can either do it as the application using the application permissions, or you can use delegated permissions. For delegated permissions, either the user or an administrator consents to the permissions that the app requests. The app is delegated with the permission to act as a signed-in user when it makes calls to the target resource. Application permissions are used by apps that do not require a signed in user present and thus require application permissions. Because of this, only administrators can consent to application permissions.

articles/active-directory-b2c/user-flow-custom-attributes.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Your Azure AD B2C directory comes with a [built-in set of attributes](user-profi
2929

3030
The terms *extension property*, *custom attribute*, and *custom claim* refer to the same thing in the context of this article. The name varies depending on the context, such as application, object, or policy.
3131

32-
Azure AD B2C allows you to extend the set of attributes stored on each user account. You can also read and write these attributes by using the [Microsoft Graph API](microsoft-graph-operations.md).
32+
Azure AD B2C allows you to extend the set of attributes stored on each user account. You can also read and write these attributes by using the [Microsoft Graph API](microsoft-graph-operations.md#application-extension-directory-extension-properties).
3333

3434
## Prerequisites
3535

@@ -58,7 +58,7 @@ The custom attribute is now available in the list of **User attributes** and for
5858
1. Select **Application claims** and then select the custom attribute.
5959
1. Select **Save**.
6060

61-
Once you've created a new user using a user flow, which uses the newly created custom attribute, the object can be queried in [Microsoft Graph Explorer](https://developer.microsoft.com/graph/graph-explorer). Alternatively you can use the [Run user flow](./tutorial-create-user-flows.md) feature on the user flow to verify the customer experience. You should now see **ShoeSize** in the list of attributes collected during the sign-up journey, and see it in the token sent back to your application.
61+
Once you've created a new user using the user flow, you can use the [Run user flow](./tutorial-create-user-flows.md) feature on the user flow to verify the customer experience. You should now see **ShoeSize** in the list of attributes collected during the sign-up journey, and see it in the token sent back to your application.
6262

6363
::: zone-end
6464

@@ -144,7 +144,7 @@ You can create these attributes by using the portal UI before or after you use t
144144
|Name |Used in |
145145
|---------|---------|
146146
|`extension_loyaltyId` | Custom policy|
147-
|`extension_<b2c-extensions-app-guid>_loyaltyId` | [Microsoft Graph API](microsoft-graph-operations.md)|
147+
|`extension_<b2c-extensions-app-guid>_loyaltyId` | [Microsoft Graph API](microsoft-graph-operations.md#application-extension-directory-extension-properties)|
148148

149149
The following example demonstrates the use of custom attributes in an Azure AD B2C custom policy claim definition.
150150

@@ -179,22 +179,22 @@ The following example demonstrates the use of a custom attribute in Azure AD B2C
179179

180180
## Manage extension attributes through Microsoft Graph
181181

182-
You can use the Microsoft Graph API to create and manage extension attributes then set the values for a user.
182+
You can use Microsoft Graph to create and manage the custom attributes then set the values for a user. Extension attributes are also called directory or Azure AD extensions.
183183

184-
Extension attributes in the Microsoft Graph API are named by using the convention `extension_ApplicationClientID_attributename`, where the `ApplicationClientID` is equivalent to the **appId** but without the hyphens. For example, if the **appId** of the `b2c-extensions-app` application is `25883231-668a-43a7-80b2-5685c3f874bc` and the **attributename** is `loyaltyId`, then the extension attribute will be named `extension_25883231668a43a780b25685c3f874bc_loyaltyId`.
184+
Custom attributes (directory extensions) in the Microsoft Graph API are named by using the convention `extension_{appId-without-hyphens}_{extensionProperty-name}` where `{appId-without-hyphens}` is the stripped version of the **appId** (called Client ID on the Azure AD B2C portal) for the `b2c-extensions-app` with only characters 0-9 and A-Z. For example, if the **appId** of the `b2c-extensions-app` application is `25883231-668a-43a7-80b2-5685c3f874bc` and the attribute name is `loyaltyId`, then the custom attribute will be named `extension_25883231668a43a780b25685c3f874bc_loyaltyId`.
185185

186-
Learn how to [manage extension attributes in your Azure AD B2C tenant](microsoft-graph-operations.md#application-extension-properties) using the Microsoft Graph API.
186+
Learn how to [manage extension attributes in your Azure AD B2C tenant](microsoft-graph-operations.md#application-extension-directory-extension-properties) using the Microsoft Graph API.
187187

188188
## Remove extension attribute
189189

190-
Unlike built-in attributes, extension/custom attributes can be removed. The extension attributes' values can also be removed.
190+
Unlike built-in attributes, custom attributes can be removed. The extension attributes' values can also be removed.
191191

192192
> [!Important]
193-
> Before you remove the extension/custom attribute, for each account in the directory, set the extension attribute value to `null`. In this way you explicitly remove the extension attributes’s values. Then continue to remove the extension attribute itself. Extension/custom attribute is queryable using MS Graph API.
193+
> Before you remove the custom attribute, for each account in the directory, set the extension attribute value to `null`. In this way you explicitly remove the extension attributes’s values. Then continue to remove the extension attribute itself. Custom attributes can be queries using Microsoft Graph API.
194194
195195
::: zone pivot="b2c-user-flow"
196196

197-
Use the following steps to remove extension/custom attribute from a user flow in your:
197+
Use the following steps to remove a custom attribute from a user flow in your:
198198

199199
1. Sign in to the [Azure portal](https://portal.azure.com/) as the global administrator of your Azure AD B2C tenant.
200200
2. Make sure you're using the directory that contains your Azure AD B2C tenant:
@@ -208,7 +208,7 @@ Use the following steps to remove extension/custom attribute from a user flow in
208208

209209
::: zone pivot="b2c-custom-policy"
210210

211-
Use the [Microsoft Graph API](microsoft-graph-operations.md#application-extension-properties) to delete the extension attribute from the application or to delete the extension attribute from the user.
211+
Use the [Microsoft Graph API](microsoft-graph-operations.md#application-extension-directory-extension-properties) to manage the custom attributes.
212212

213213
::: zone-end
214214

@@ -222,4 +222,4 @@ Follow the guidance for how to [add claims and customize user input using custom
222222

223223
<!-- LINKS -->
224224
[ms-graph]: /graph/
225-
[ms-graph-api]: /graph/api/overview
225+
[ms-graph-api]: /graph/api/overview

0 commit comments

Comments
 (0)