Beispiel #1
0
        /// <summary>
        /// Get Headers with Bearer Token
        /// </summary>
        /// <param name="authenticationHelper"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public static async Task <Dictionary <string, List <string> > > GetHttpRequestHeaders(this IAuthenticationHelper authenticationHelper, AuthenticationHelperSettings settings)
        {
            var headers = new Dictionary <string, List <string> >();
            var authenticationResult = await authenticationHelper
                                       .AcquireTokenAsync(settings)
                                       .ConfigureAwait(false);

            headers.AddAuthorizationHeader(authenticationResult.AccessTokenType, authenticationResult.AccessToken);
            return(headers);
        }