Skip to content

Commit

Permalink
Update ExchangeOAuth2.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast authored Aug 19, 2023
1 parent ddee402 commit 8c6400e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ExchangeOAuth2.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ server.

```csharp
var confidentialClientApplication = ConfidentialClientApplicationBuilder.Create (clientId)
.WithAuthority ($"https://login.microsoftonline.com/{tenantId}/v2.0")
.WithCertificate (certificate) // or .WithClientSecret (clientSecret)
.Build ();

Expand All @@ -132,8 +133,7 @@ var scopes = new string[] {
// "https://outlook.office365.com/.default"
};

var authToken = await confidentialClientApplication.AcquireTokenForClient (scopes)
.WithAuthority (AzureCloudInstance.AzurePublic, "{tenantID}").ExecuteAsync ();
var authToken = await confidentialClientApplication.AcquireTokenForClient (scopes).ExecuteAsync ();
var oauth2 = new SaslMechanismOAuth2 (authToken.Account.Username, authToken.AccessToken);

using (var client = new ImapClient ()) {
Expand Down

0 comments on commit 8c6400e

Please sign in to comment.