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/sentinel/stix-objects-api.md
+59-3Lines changed: 59 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,14 +57,70 @@ Acquire a Microsoft Entra access token with [OAuth 2.0 authentication](../active
57
57
58
58
The version of the token (v1.0 or v2.0) received is determined by the `accessTokenAcceptedVersion` property in the [app manifest](/entra/identity-platform/reference-app-manifest#manifest-reference) of the API that your application is calling. If `accessTokenAcceptedVersion` is set to 1, then your application receives a v1.0 token.
59
59
60
-
Use Microsoft Authentication Library [(MSAL)](/entra/identity-platform/msal-overview) to acquire either a v1.0 or v2.0 access token. Or, send requests to the REST API in the following format:
60
+
Use Microsoft Authentication Library [(MSAL)](/entra/identity-platform/msal-overview) to acquire either a v1.0 or v2.0 access token. Use the access token to create the authorization header which contains the bearer token.
61
+
62
+
For example, a request to the upload API uses the following elements to retrieve an access token and create the authorization header:
61
63
- POST `https://login.microsoftonline.com/{{tenantId}}/oauth2/v2.0/token`
62
-
- Headers for using Microsoft Entra App:
64
+
65
+
Headers for using Microsoft Entra App:
63
66
- grant_type: "client_credentials"
64
67
- client_id: {Client ID of Microsoft Entra App}
65
-
- client_secret: {secret of Microsoft Entra App}
68
+
- client_secret or client_certificate: {secrets of the Microsoft Entra App}
Here's a sample powershell function that uses a self-signed certificate uploaded to the Entra app registration to generate the access token and authorization header:
72
+
73
+
```PowerShell
74
+
function Test-UploadApi {
75
+
<#
76
+
.SYNOPSIS
77
+
requires Powershell module MSAL.PS version 4.37 or higher
# Connection details for getting initial token with self-signed certificate from local store
97
+
# To create a secure self-signed certificate, see New-SelfSignedApiCert.ps1 https://github.com/austinmccollum/PS-solutions/blob/main/New-SelfSignedApiCert.ps1
If `accessTokenAcceptedVersion` in the app manifest is set to 1, your application receives a v1.0 access token even though it's calling the v2 token endpoint.
69
125
70
126
The resource/scope value is the audience of the token. This API only accepts the following audiences:
0 commit comments