private static AuthenticationContext GetAuthenticationContext() { var authority = string.Format("{0}{1}", AADAppSettings.AuthorizationUri, AADAppSettings.TenantId); var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value; var tokenCache = new NaiveSessionCache(signInUserId); return(new AuthenticationContext(authority, tokenCache)); }
private static AuthenticationContext GetAuthenticationContext() { var tenantId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/tenantid").Value; var authority = string.Format("{0}/{1}", AADAppSettings.AuthorizationUri, tenantId); var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value; var tokenCache = new NaiveSessionCache(signInUserId); return new AuthenticationContext(authority, tokenCache); }
private static AuthenticationContext GetAuthenticationContext() { var authority = string.Format("{0}{1}", AADAppSettings.AuthorizationUri, AADAppSettings.TenantId); var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value; var tokenCache = new NaiveSessionCache(signInUserId); return new AuthenticationContext(authority, tokenCache); }