mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-05-12 05:17:22 +00:00
update code block
This commit is contained in:
parent
878828fff6
commit
166d72abb5
@ -178,10 +178,11 @@ Here is an example return value:
|
||||
The following code example demonstrates how to obtain an access token and call the Microsoft Defender ATP API.
|
||||
|
||||
```csharp
|
||||
AuthenticationContext context = new AuthenticationContext(string.Format("https://login.windows.net/{0}/oauth2", tenantId));
|
||||
AuthenticationContext context = new AuthenticationContext(string.Format("https://login.windows.net/{0}", tenantId));
|
||||
ClientCredential clientCredentials = new ClientCredential(clientId, clientSecret);
|
||||
AuthenticationResult authenticationResult = context.AcquireToken(resource, clientCredentials);
|
||||
AuthenticationResult authenticationResult = context.AcquireTokenAsync(detectionsResource, clientCredentials).GetAwaiter().GetResult();
|
||||
```
|
||||
|
||||
### Use token to connect to the detections endpoint
|
||||
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user