コード例 #1
0
        private async Task <AuthenticationResult> AcquireTokenByAuthorizationCodeCommonAsync(string authorizationCode, Uri redirectUri, ClientKey clientKey, string resource)
        {
            const string nullResource = "null_resource_as_optional";
            RequestData  requestData  = new RequestData
            {
                Authenticator           = this.Authenticator,
                TokenCache              = this.TokenCache,
                Resource                = resource,
                ClientKey               = clientKey,
                ExtendedLifeTimeEnabled = this.ExtendedLifeTimeEnabled
            };

            if (requestData.Resource == null)
            {
                requestData.Resource = nullResource;
            }
            var handler = new AcquireTokenByAuthorizationCodeHandler(requestData, authorizationCode, redirectUri);

            return(await handler.RunAsync().ConfigureAwait(false));
        }
コード例 #2
0
        private async Task <AuthenticationResult> AcquireTokenByAuthorizationCodeCommonAsync(string authorizationCode, Uri redirectUri, ClientKey clientKey, string resource, bool callSync = false)
        {
            var handler = new AcquireTokenByAuthorizationCodeHandler(this.Authenticator, this.TokenCache, resource, clientKey, authorizationCode, redirectUri, callSync);

            return(await handler.RunAsync());
        }
 private async Task<AuthenticationResult> AcquireTokenByAuthorizationCodeCommonAsync(string authorizationCode, Uri redirectUri, ClientKey clientKey, string resource)
 {
     var handler = new AcquireTokenByAuthorizationCodeHandler(this.Authenticator, this.TokenCache, resource, clientKey, authorizationCode, redirectUri);
     return await handler.RunAsync();
 }
コード例 #4
0
 private async Task<AuthenticationResult> AcquireTokenByAuthorizationCodeCommonAsync(string authorizationCode,
     Uri redirectUri, ClientKey clientKey, string[] scope, string extraQueryParameters = null)
 {
     var handler = new AcquireTokenByAuthorizationCodeHandler(this.Authenticator, this.TokenCache, scope,
         clientKey, authorizationCode, redirectUri, extraQueryParameters);
     return await handler.RunAsync();
 }