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/reports-monitoring/tutorial-access-api-with-certificates.md
+13-16Lines changed: 13 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,10 +42,10 @@ In this tutorial, you learn how to use a test certificate to access the MS Graph
42
42
- Access tokens from user, application keys, and certificates using ADAL
43
43
- Graph API handling paged results
44
44
45
-
6. If it's your first time using the module run **Install-MSCloudIdUtilsModule**, otherwise import it using the **Import-Module**Powershell command. Your session should look similar to this screen:
6. If it's your first time using the module run **Install-MSCloudIdUtilsModule**, otherwise import it using the **Import-Module**PowerShell command. Your session should look similar to this screen:
@@ -62,13 +62,13 @@ In this tutorial, you learn how to use a test certificate to access the MS Graph
62
62
63
63
1. Navigate to the [Azure portal](https://portal.azure.com), select **Azure Active Directory**, then select **App registrations** and choose your application from the list.
64
64
65
-
2. Select **Settings**>**Keys** and select **Upload Public Key**.
65
+
2. Select **Certificates & secrets**under**Manage**section on Application registration blade and select **Upload Certificate**.
66
66
67
-
3. Select the certificate file from the previous step and select **Save**.
67
+
3. Select the certificate file from the previous step and select **Add**.
68
68
69
-
4. Note the Application ID, and the thumbprint of the certificate you just registered with your application. To find the thumbprint, from your application page in the portal, go to **Settings**and click **Keys**. The thumbprint will be under the **Public Keys** list.
69
+
4. Note the Application ID, and the thumbprint of the certificate you just registered with your application. To find the thumbprint, from your application page in the portal, go to **Certificates & secrets**under **Manage** section. The thumbprint will be under the **Certificates** list.
70
70
71
-
5. Open the application manifest in the inline manifest editor and replace the *keyCredentials* property with your new certificate information using the following schema.
71
+
5. Open the application manifest in the inline manifest editor and verify the *keyCredentials* property is updated with your new certificate information as shown below -
72
72
73
73
```
74
74
"keyCredentials": [
@@ -80,23 +80,20 @@ In this tutorial, you learn how to use a test certificate to access the MS Graph
80
80
"value": "$base64Value" //base64 encoding of the certificate raw data
81
81
}
82
82
]
83
-
```
84
-
85
-
6. Save the manifest.
86
-
87
-
7. Now, you can get an access token for the MS Graph API using this certificate. Use the **Get-MSCloudIdMSGraphAccessTokenFromCert** cmdlet from the MSCloudIdUtils PowerShell module, passing in the Application ID and the thumbprint you obtained from the previous step.
83
+
```
84
+
6. Now, you can get an access token for the MS Graph API using this certificate. Use the **Get-MSCloudIdMSGraphAccessTokenFromCert** cmdlet from the MSCloudIdUtils PowerShell module, passing in the Application ID and the thumbprint you obtained from the previous step.
8. Use the access token in your Powershell script to query the Graph API. Use the **Invoke-MSCloudIdMSGraphQuery** cmdlet from the MSCloudIDUtils to enumerate the signins and directoryAudits endpoint. This cmdlet handles multi-paged results, and sends those results to the PowerShell pipeline.
88
+
7. Use the access token in your PowerShell script to query the Graph API. Use the **Invoke-MSCloudIdMSGraphQuery** cmdlet from the MSCloudIDUtils to enumerate the signins and directoryAudits endpoint. This cmdlet handles multi-paged results, and sends those results to the PowerShell pipeline.
92
89
93
-
9. Query the directoryAudits endpoint to retrieve the audit logs.
90
+
8. Query the directoryAudits endpoint to retrieve the audit logs.
11. You can now choose to export this data to a CSV and save to a SIEM system. You can also wrap your script in a scheduled task to get Azure AD data from your tenant periodically without having to store application keys in the source code.
96
+
10. You can now choose to export this data to a CSV and save to a SIEM system. You can also wrap your script in a scheduled task to get Azure AD data from your tenant periodically without having to store application keys in the source code.
0 commit comments