Merge pull request #1357 from MicrosoftDocs/api-fix

update code block
This commit is contained in:
Rebecca Agiewich 2019-10-16 11:46:05 -07:00 committed by GitHub
commit 84fbd68499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
```