Created
March 2, 2015 16:38
-
-
Save TBag/94fbe8d843c1eefbb1f0 to your computer and use it in GitHub Desktop.
GetActiveDirectoryClientmethod from Property Inspection Code Sample. Part of the AuthenticationHelper class found here: https://github.com/OfficeDev/Property-Inspection-Code-Sample/blob/master/PropertyManagerMyApp/PropertyManagerMyApp/Utils/AuthenticationHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private async Task<ActiveDirectoryClient> GetActiveDirectoryClient() | |
| { | |
| Uri baseServiceUri = new Uri(AADAppSettings.AADGraphResourceId); | |
| var tenantId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/tenantid").Value; | |
| ActiveDirectoryClient activeDirectoryClient = | |
| new ActiveDirectoryClient(new Uri(baseServiceUri, tenantId), | |
| async () => await AcquireTokenAsync()); | |
| return activeDirectoryClient; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment