You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/add-api-connector-token-enrichment.md
+7-16Lines changed: 7 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
---
1
2
title: Token enrichment - Azure Active Directory B2C
2
3
description: Enrich tokens with claims from external identity data sources using APIs or outbound webhooks.
3
4
services: active-directory-b2c
@@ -7,6 +8,7 @@ manager: CelesteDG
7
8
ms.service: active-directory
8
9
ms.workload: identity
9
10
ms.topic: how-to
11
+
10
12
ms.date: 01/17/2023
11
13
ms.author: godonnell
12
14
ms.subservice: B2C
@@ -32,42 +34,30 @@ You can create an API endpoint using one of our [samples](api-connector-samples.
32
34
To use an [API connector](api-connectors-overview.md), you first create the API connector and then enable it in a user flow.
33
35
34
36
1. Sign in to the [Azure portal](https://portal.azure.com/).
35
-
2. Under **Azure services**, select **Azure AD B2C**.
36
-
4. Select **API connectors**, and then select **New API connector**.
37
37
1. Under **Azure services**, select **Azure AD B2C**.
38
38
1. Select **API connectors**, and then select **New API connector**.
39
39
40
-

41
40

42
41
43
-
5. Provide a display name for the call. For example, **Enrich token from external source**.
44
-
6. Provide the **Endpoint URL** for the API call.
45
-
7. Choose the **Authentication type** and configure the authentication information for calling your API. Learn how to [Secure your API Connector](secure-rest-api.md).
46
42
1. Provide a display name for the call. For example, **Enrich token from external source**.
47
43
1. Provide the **Endpoint URL** for the API call.
48
44
1. Choose the **Authentication type** and configure the authentication information for calling your API. Learn how to [Secure your API Connector](secure-rest-api.md).
49
45
50
-

51
46

52
47
53
-
8. Select **Save**.
54
48
1. Select **Save**.
55
49
56
50
## Enable the API connector in a user flow
57
51
58
52
Follow these steps to add an API connector to a sign-up user flow.
59
53
60
54
1. Sign in to the [Azure portal](https://portal.azure.com/).
61
-
2. Under **Azure services**, select **Azure AD B2C**.
62
-
4. Select **User flows**, and then select the user flow you want to add the API connector to.
63
-
5. Select **API connectors**, and then select the API endpoint you want to invoke at the **Before sending the token (preview)** step in the user flow:
64
55
1. Under **Azure services**, select **Azure AD B2C**.
65
56
1. Select **User flows**, and then select the user flow you want to add the API connector to.
66
57
1. Select **API connectors**, and then select the API endpoint you want to invoke at the **Before sending the token (preview)** step in the user flow:
67
58
68
59

69
60
70
-
6. Select **Save**.
71
61
1. Select **Save**.
72
62
73
63
This step only exists for **Sign up and sign in (Recommended)**, **Sign up (Recommended)**, and **Sign in (Recommended)** user flows.
| version | String | Yes | The version of your API. |
122
+
git | version | String | Yes | The version of your API. |
133
123
| action | String | Yes | Value must be `Continue`. |
134
124
|\<builtInUserAttribute> |\<attribute-type> | No | They can be returned in the token if selected as an **Application claim**. |
135
125
|\<extension\_{extensions-app-id}\_CustomAttribute> |\<attribute-type> | No | The claim does not need to contain `_<extensions-app-id>_`, it is *optional*. They can returned in the token if selected as an **Application claim**. |
136
126
::: zone-end
137
127
::: zone pivot="b2c-custom-policy"
128
+
138
129
In this scenario, we enrich the user's token data by integrating with a corporate line-of-business workflow. During sign-up or sign-in with local or federated account, Azure AD B2C invokes a REST API to get the user's extended profile data from a remote data source. In this sample, Azure AD B2C sends the user's unique identifier, the objectId. The REST API then returns the user's account balance (a random number). Use this sample as a starting point to integrate with your own CRM system, marketing database, or any line-of-business workflow.
139
130
You can also design the interaction as a validation technical profile. This is suitable when the REST API will be validating data on screen and returning claims. For more information, see [Walkthrough: Add an API connector to a sign-up user flow](add-api-connector.md).
140
131
## Prerequisites
@@ -335,9 +326,9 @@ In general, it's helpful to use the logging tools enabled by your web API servic
335
326
* Monitor your API for long response times.
336
327
Additionally, Azure AD B2C logs metadata about the API transactions that happen during user authentications via a user flow. To find these:
337
328
1. Go to **Azure AD B2C**
338
-
2. Under **Activities**, select **Audit logs**.
339
-
3. Filter the list view: For **Date**, select the time interval you want, and for **Activity**, select **An API was called as part of a user flow**.
340
-
4. Inspect individual logs. Each row represents an API connector attempting to be called during a user flow. If an API call fails and a retry occurs, it's still represented as a single row. The `numberOfAttempts` indicates the number of times your API was called. This value can be `1`or `2`. Other information about the API call is detailed in the logs.
329
+
1. Under **Activities**, select **Audit logs**.
330
+
1. Filter the list view: For **Date**, select the time interval you want, and for **Activity**, select **An API was called as part of a user flow**.
331
+
1. Inspect individual logs. Each row represents an API connector attempting to be called during a user flow. If an API call fails and a retry occurs, it's still represented as a single row. The `numberOfAttempts` indicates the number of times your API was called. This value can be `1`or `2`. Other information about the API call is detailed in the logs.
341
332

0 commit comments