Skip to content

Commit 7c46edd

Browse files
committed
[b2c][seo] remove filename prefix 008
1 parent 26362e7 commit 7c46edd

File tree

59 files changed

+1374
-1338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1374
-1338
lines changed
Lines changed: 2 additions & 255 deletions
Original file line numberDiff line numberDiff line change
@@ -1,257 +1,4 @@
11
---
2-
title: Access and review audit logs
3-
titleSuffix: Azure AD B2C
4-
description: How to access Azure AD B2C audit logs programmatically and in the Azure portal.
5-
services: active-directory-b2c
6-
author: mmacy
7-
manager: celestedg
8-
9-
ms.service: active-directory
10-
ms.topic: conceptual
11-
ms.workload: identity
12-
ms.date: 10/16/2019
13-
ms.author: marsma
14-
ms.subservice: B2C
15-
ms.custom: fasttrack-edit
2+
redirect_url: /azure/active-directory-b2c/view-audit-logs
3+
redirect_document_id: true
164
---
17-
18-
# Accessing Azure AD B2C audit logs
19-
20-
Azure Active Directory B2C (Azure AD B2C) emits audit logs containing activity information about B2C resources, tokens issued, and administrator access. This article provides a brief overview of the information available in audit logs and instructions on how to access this data for your Azure AD B2C tenant.
21-
22-
Audit log events are only retained for **seven days**. Plan to download and store your logs using one of the methods shown below if you require a longer retention period.
23-
24-
> [!NOTE]
25-
> You can't see user sign-ins for individual Azure AD B2C applications under the **Users** section of the **Azure Active Directory** or **Azure AD B2C** pages in the Azure portal. The sign-in events there show user activity, but can't be correlated back to the B2C application that the user signed in to. You must use the audit logs for that, as explained further in this article.
26-
27-
## Overview of activities available in the B2C category of audit logs
28-
29-
The **B2C** category in audit logs contains the following types of activities:
30-
31-
|Activity type |Description |
32-
|---------|---------|
33-
|Authorization |Activities concerning the authorization of a user to access B2C resources (for example, an administrator accessing a list of B2C policies). |
34-
|Directory |Activities related to directory attributes retrieved when an administrator signs in using the Azure portal. |
35-
|Application | Create, read, update, and delete (CRUD) operations on B2C applications. |
36-
|Key |CRUD operations on keys stored in a B2C key container. |
37-
|Resource |CRUD operations on B2C resources. For example, policies and identity providers.
38-
|Authentication |Validation of user credentials and token issuance.|
39-
40-
For user object CRUD activities, refer to the **Core Directory** category.
41-
42-
## Example activity
43-
44-
This example image from the Azure portal shows the data captured when a user signs in with an external identity provider, in this case, Facebook:
45-
46-
![Example of Audit Log Activity Details page in Azure portal](./media/active-directory-b2c-reference-audit-logs/audit-logs-example.png)
47-
48-
The activity details panel contains the following relevant information:
49-
50-
|Section|Field|Description|
51-
|-------|-----|-----------|
52-
| Activity | Name | Which activity took place. For example, *Issue an id_token to the application*, which concludes the actual user sign-in. |
53-
| Initiated By (Actor) | ObjectId | The **Object ID** of the B2C application that the user is signing in to. This identifier is not visible in the Azure portal, but is accessible via the Microsoft Graph API. |
54-
| Initiated By (Actor) | Spn | The **Application ID** of the B2C application that the user is signing in to. |
55-
| Target(s) | ObjectId | The **Object ID** of the user that is signing in. |
56-
| Additional Details | TenantId | The **Tenant ID** of the Azure AD B2C tenant. |
57-
| Additional Details | PolicyId | The **Policy ID** of the user flow (policy) being used to sign the user in. |
58-
| Additional Details | ApplicationId | The **Application ID** of the B2C application that the user is signing in to. |
59-
60-
## View audit logs in the Azure portal
61-
62-
The Azure portal provides access to the audit log events in your Azure AD B2C tenant.
63-
64-
1. Sign in to the [Azure portal](https://portal.azure.com)
65-
1. Switch to the directory that contains your Azure AD B2C tenant, and then browse to **Azure AD B2C**.
66-
1. Under **Activities** in the left menu, select **Audit logs**.
67-
68-
A list of activity events logged over the last seven days is displayed.
69-
70-
![Example filter with two activity events in Azure portal](media/active-directory-b2c-reference-audit-logs/audit-logs-example-filter.png)
71-
72-
Several filtering options are available, including:
73-
74-
* **Activity Resource Type** - Filter by the activity types shown in the table in the [Overview of activities available](#overview-of-activities-available-in-the-b2c-category-of-audit-logs) section.
75-
* **Date** - Filter the date range of the activities shown.
76-
77-
If you select a row in the list, the activity details for the event are displayed.
78-
79-
To download the list of activity events in a comma-separated values (CSV) file, select **Download**.
80-
81-
## Get audit logs with the Azure AD reporting API
82-
83-
Audit logs are published to the same pipeline as other activities for Azure Active Directory, so they can be accessed through the [Azure Active Directory reporting API](https://docs.microsoft.com/graph/api/directoryaudit-list). For more information, see [Get started with the Azure Active Directory reporting API](../active-directory/reports-monitoring/concept-reporting-api.md).
84-
85-
### Enable reporting API access
86-
87-
To allow script- or application-based access to the Azure AD reporting API, you need an Azure Active Directory application registered in your Azure AD B2C tenant with the following API permissions:
88-
89-
* Microsoft Graph > Application permissions > AuditLog.Read.All
90-
91-
You can enable these permissions on an existing Azure Active Directory application registration within your B2C tenant, or create a new one specifically for use with audit log automation.
92-
93-
Follow these steps register an application, grant it the required Microsoft Graph API permissions, and then create a client secret.
94-
95-
### Register application in Azure Active Directory
96-
97-
[!INCLUDE [active-directory-b2c-appreg-mgmt](../../includes/active-directory-b2c-appreg-mgmt.md)]
98-
99-
### Assign API access permissions
100-
101-
#### [Applications](#tab/applications/)
102-
103-
1. On the **Registered app** overview page, select **Settings**.
104-
1. Under **API ACCESS**, select **Required permissions**.
105-
1. Select **Add**, and then **Select an API**.
106-
1. Select **Microsoft Graph**, and then **Select**.
107-
1. Under **APPLICATION PERMISSIONS**, select **Read all audit log data**.
108-
1. Select the **Select** button, and then select **Done**.
109-
1. Select **Grant permissions**, and then select **Yes**.
110-
111-
#### [App registrations (Preview)](#tab/app-reg-preview/)
112-
113-
1. Under **Manage**, select **API permissions**.
114-
1. Under **Configured permissions**, select **Add a permission**.
115-
1. Select the **Microsoft APIs** tab.
116-
1. Select **Microsoft Graph**.
117-
1. Select **Application permissions**.
118-
1. Expand **AuditLog** and then select the **AuditLog.Read.All** check box.
119-
1. Select **Add permissions**. As directed, wait a few minutes before proceeding to the next step.
120-
1. Select **Grant admin consent for (your tenant name)**.
121-
1. Select your currently signed-in account if it's been assigned the *Global Administrator* role, or sign in with an account in your Azure AD B2C tenant that's been assigned the *Global Administrator* role.
122-
1. Select **Accept**.
123-
1. Select **Refresh**, and then verify that "Granted for ..." appears under **Status** for the *AuditLog.Read.All* permission. It might take a few minutes for the permissions to propagate.
124-
125-
* * *
126-
127-
### Create client secret
128-
129-
[!INCLUDE [active-directory-b2c-client-secret](../../includes/active-directory-b2c-client-secret.md)]
130-
131-
You now have an application with the required API access, an application ID, and a key that you can use in your automation scripts. See the PowerShell script section later in this article for an example of how you can get activity events with a script.
132-
133-
### Access the API
134-
135-
To download Azure AD B2C audit log events via the API, filter the logs on the `B2C` category. To filter by category, use the `filter` query string parameter when you call the Azure AD reporting API endpoint.
136-
137-
```HTTP
138-
https://graph.microsoft.com/v1.0/auditLogs/directoryAudits?$filter=loggedByService eq 'B2C' and activityDateTime gt 2019-09-10T02:28:17Z
139-
```
140-
141-
### PowerShell script
142-
143-
The following PowerShell script shows an example of how to query the Azure AD reporting API. After querying the API, it prints the logged events to standard output, then writes the JSON output to a file.
144-
145-
You can try this script in the [Azure Cloud Shell](../cloud-shell/overview.md). Be sure to update it with your application ID, client secret, and the name of your Azure AD B2C tenant.
146-
147-
```powershell
148-
# This script requires the registration of a Web Application in Azure Active Directory:
149-
# https://docs.microsoft.com/azure/active-directory/reports-monitoring/concept-reporting-api
150-
151-
# Constants
152-
$ClientID = "your-client-application-id-here" # Insert your application's client ID, a GUID (registered by Global Admin)
153-
$ClientSecret = "your-client-application-secret-here" # Insert your application's client secret
154-
$tenantdomain = "your-b2c-tenant.onmicrosoft.com" # Insert your Azure AD B2C tenant; for example, contoso.onmicrosoft.com
155-
$loginURL = "https://login.microsoftonline.com"
156-
$resource = "https://graph.microsoft.com" # Microsoft Graph API resource URI
157-
$7daysago = "{0:s}" -f (get-date).AddDays(-7) + "Z" # Use 'AddMinutes(-5)' to decrement minutes, for example
158-
Write-Output "Searching for events starting $7daysago"
159-
160-
# Create HTTP header, get an OAuth2 access token based on client id, secret and tenant domain
161-
$body = @{grant_type="client_credentials";resource=$resource;client_id=$ClientID;client_secret=$ClientSecret}
162-
$oauth = Invoke-RestMethod -Method Post -Uri $loginURL/$tenantdomain/oauth2/token?api-version=1.0 -Body $body
163-
164-
# Parse audit report items, save output to file(s): auditX.json, where X = 0 through n for number of nextLink pages
165-
if ($oauth.access_token -ne $null) {
166-
$i=0
167-
$headerParams = @{'Authorization'="$($oauth.token_type) $($oauth.access_token)"}
168-
$url = "https://graph.microsoft.com/v1.0/auditLogs/directoryAudits?`$filter=loggedByService eq 'B2C' and activityDateTime gt " + $7daysago
169-
170-
# loop through each query page (1 through n)
171-
Do {
172-
# display each event on the console window
173-
Write-Output "Fetching data using Uri: $url"
174-
$myReport = (Invoke-WebRequest -UseBasicParsing -Headers $headerParams -Uri $url)
175-
foreach ($event in ($myReport.Content | ConvertFrom-Json).value) {
176-
Write-Output ($event | ConvertTo-Json)
177-
}
178-
179-
# save the query page to an output file
180-
Write-Output "Save the output to a file audit$i.json"
181-
$myReport.Content | Out-File -FilePath audit$i.json -Force
182-
$url = ($myReport.Content | ConvertFrom-Json).'@odata.nextLink'
183-
$i = $i+1
184-
} while($url -ne $null)
185-
} else {
186-
Write-Host "ERROR: No Access Token"
187-
}
188-
```
189-
190-
Here's the JSON representation of the example activity event shown earlier in the article:
191-
192-
```JSON
193-
{
194-
"id": "B2C_DQO3J_4984536",
195-
"category": "Authentication",
196-
"correlationId": "00000000-0000-0000-0000-000000000000",
197-
"result": "success",
198-
"resultReason": "N/A",
199-
"activityDisplayName": "Issue an id_token to the application",
200-
"activityDateTime": "2019-09-14T18:13:17.0618117Z",
201-
"loggedByService": "B2C",
202-
"operationType": "",
203-
"initiatedBy": {
204-
"user": null,
205-
"app": {
206-
"appId": "00000000-0000-0000-0000-000000000000",
207-
"displayName": null,
208-
"servicePrincipalId": null,
209-
"servicePrincipalName": "00000000-0000-0000-0000-000000000000"
210-
}
211-
},
212-
"targetResources": [
213-
{
214-
"id": "00000000-0000-0000-0000-000000000000",
215-
"displayName": null,
216-
"type": "User",
217-
"userPrincipalName": null,
218-
"groupType": null,
219-
"modifiedProperties": []
220-
}
221-
],
222-
"additionalDetails": [
223-
{
224-
"key": "TenantId",
225-
"value": "test.onmicrosoft.com"
226-
},
227-
{
228-
"key": "PolicyId",
229-
"value": "B2C_1A_signup_signin"
230-
},
231-
{
232-
"key": "ApplicationId",
233-
"value": "00000000-0000-0000-0000-000000000000"
234-
},
235-
{
236-
"key": "Client",
237-
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
238-
},
239-
{
240-
"key": "IdentityProviderName",
241-
"value": "facebook"
242-
},
243-
{
244-
"key": "IdentityProviderApplicationId",
245-
"value": "0000000000000000"
246-
},
247-
{
248-
"key": "ClientIpAddress",
249-
"value": "127.0.0.1"
250-
}
251-
]
252-
}
253-
```
254-
255-
## Next steps
256-
257-
You can automate other administration tasks, for example, [manage users with .NET](manage-user-accounts-graph-api.md).
Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,4 @@
11
---
2-
title: Define custom attributes in Azure Active Directory B2C | Microsoft Docs
3-
description: Define custom attributes for your application in Azure Active Directory B2C to collect information about your customers.
4-
services: active-directory-b2c
5-
author: mmacy
6-
manager: celestedg
7-
8-
ms.service: active-directory
9-
ms.workload: identity
10-
ms.topic: conceptual
11-
ms.date: 11/30/2018
12-
ms.author: marsma
13-
ms.subservice: B2C
2+
redirect_url: /azure/active-directory-b2c/user-flow-custom-attributes
3+
redirect_document_id: true
144
---
15-
16-
# Define custom attributes in Azure Active Directory B2C
17-
18-
Every customer-facing application has unique requirements for the information that needs to be collected. Your Azure Active Directory B2C (Azure AD B2C) tenant comes with a built-in set of information stored in attributes, such as Given Name, Surname, City, and Postal Code. With Azure AD B2C, you can extend the set of attributes stored on each customer account.
19-
20-
You can create custom attributes in the [Azure portal](https://portal.azure.com/) and use them in your sign-up user flows, sign-up or sign-in user flows, or profile editing user flows. You can also read and write these attributes by using the [Azure AD Graph API](manage-user-accounts-graph-api.md). Custom attributes in Azure AD B2C use [Azure AD Graph API Directory Schema Extensions](/previous-versions/azure/ad/graph/howto/azure-ad-graph-api-directory-schema-extensions).
21-
22-
> [!NOTE]
23-
> Support for newer [Microsoft Graph API](https://docs.microsoft.com/graph/overview?view=graph-rest-1.0) for querying Azure AD B2C tenant is still under development.
24-
>
25-
26-
## Create a custom attribute
27-
28-
1. Sign in to the [Azure portal](https://portal.azure.com/) as the global administrator of your Azure AD B2C tenant.
29-
2. Make sure you're using the directory that contains your Azure AD B2C tenant by switching to it in the top-right corner of the Azure portal. Select your subscription information, and then select **Switch Directory**.
30-
31-
![Switch to your Azure AD B2C tenant](./media/active-directory-b2c-reference-custom-attr/switch-directories.png)
32-
33-
Choose the directory that contains your tenant.
34-
35-
![B2C tenant highlighted in Directory and Subscription filter](./media/active-directory-b2c-reference-custom-attr/select-directory.PNG)
36-
37-
3. Choose **All services** in the top-left corner of the Azure portal, search for and select **Azure AD B2C**.
38-
4. Select **User attributes**, and then select **Add**.
39-
5. Provide a **Name** for the custom attribute (for example, "ShoeSize")
40-
6. Choose a **Data Type**. Only **String**, **Boolean**, and **Int** are available.
41-
7. Optionally, enter a **Description** for informational purposes.
42-
8. Click **Create**.
43-
44-
The custom attribute is now available in the list of **User attributes** and for use in your user flows. A custom attribute is only created the first time it is used in any user flow, and not when you add it to the list of **User attributes**.
45-
46-
47-
## Use a custom attribute in your user flow
48-
49-
1. In your Azure AD B2C tenant, select **User flows**.
50-
2. Select your policy (for example, "B2C_1_SignupSignin") to open it.
51-
4. Select **User attributes** and then select the custom attribute (for example, "ShoeSize"). Click **Save**.
52-
5. Select **Application claims** and then select the custom attribute.
53-
6. Click **Save**.
54-
55-
Once you have created a new user using a user flow which uses the newly created custom attribute, the object can be queried in [Azure AD Graph Explorer](https://docs.microsoft.com/azure/active-directory/develop/active-directory-graph-api-quickstart). Alternatively you can use the [**Run user flow**](https://docs.microsoft.com/azure/active-directory-b2c/tutorial-create-user-flows) 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.
56-
Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,4 @@
11
---
2-
title: Disable email verification during customer sign-up
3-
titleSuffix: Azure AD B2C
4-
description: Learn how to disable email verification during customer sign-up in Azure Active Directory B2C.
5-
services: active-directory-b2c
6-
author: mmacy
7-
manager: celestedg
8-
9-
ms.service: active-directory
10-
ms.workload: identity
11-
ms.topic: conceptual
12-
ms.date: 09/25/2018
13-
ms.author: marsma
14-
ms.subservice: B2C
2+
redirect_url: /azure/active-directory-b2c/user-flow-disable-email-verification
3+
redirect_document_id: true
154
---
16-
17-
# Disable email verification during customer sign-up in Azure Active Directory B2C
18-
19-
By default, Azure Active Directory B2C (Azure AD B2C) verifies your customer's email address for local accounts (accounts for users who sign up with email address or username). Azure AD B2C ensures valid email addresses by requiring customers to verify them during the sign-up process. It also prevents a malicious actors from using automated processes to generate fraudulent accounts in your applications.
20-
21-
Some application developers prefer to skip email verification during the sign-up process and instead have customers verify their email address later. To support this, Azure AD B2C can be configured to disable email verification. Doing so creates a smoother sign-up process and gives developers the flexibility to differentiate customers that have verified their email address from customers that have not.
22-
23-
Follow these steps to disable email verification:
24-
25-
1. Sign in to the [Azure portal](https://portal.azure.com)
26-
1. Use the **Directory + subscription** filter in the top menu to select the directory that contains your Azure AD B2C tenant.
27-
1. In the left menu, select **Azure AD B2C**. Or, select **All services** and search for and select **Azure AD B2C**.
28-
1. Select **User flows**.
29-
1. Select the user flow for which you want to disable email verification. For example, *B2C_1_signinsignup*.
30-
1. Select **Page layouts**.
31-
1. Select **Local account sign-up page**.
32-
1. Under **User attributes**, select **Email Address**.
33-
1. In the **REQUIRES VERIFICATION** drop down, select **No**.
34-
1. Select **Save**. Email verification is now disabled for this user flow.
35-
36-
> [!WARNING]
37-
> Disabling email verification in the sign-up process may lead to spam. If you disable the default Azure AD B2C-provided email verification, we recommend that you implement a replacement verification system.

0 commit comments

Comments
 (0)