示例#1
0
        private async Task <AuthenticationResult> AcquireTokenOnBehalfCommonAsync(Authority authority,
                                                                                  string[] scope, UserAssertion userAssertion, string policy)
        {
            var requestParams = this.CreateRequestParameters(authority, scope, policy, null, this.UserTokenCache);

            requestParams.UserAssertion = userAssertion;
            var handler = new OnBehalfOfRequest(requestParams);

            return(await handler.RunAsync().ConfigureAwait(false));
        }
示例#2
0
        private async Task <AuthenticationResult> AcquireTokenOnBehalfCommonAsync(Authority authority,
                                                                                  IEnumerable <string> scopes, UserAssertion userAssertion, ApiEvent.ApiIds apiId)
        {
            var requestParams = CreateRequestParameters(authority, scopes, null, UserTokenCache);

            requestParams.UserAssertion = userAssertion;
            var handler = new OnBehalfOfRequest(requestParams)
            {
                ApiId = apiId, IsConfidentialClient = true
            };

            return(await handler.RunAsync().ConfigureAwait(false));
        }
        public async Task <AuthenticationResult> ExecuteAsync(
            AcquireTokenCommonParameters commonParameters,
            AcquireTokenOnBehalfOfParameters onBehalfOfParameters,
            CancellationToken cancellationToken)
        {
            var requestContext = CreateRequestContextAndLogVersionInfo(commonParameters.CorrelationId);

            var requestParams = _confidentialClientApplication.CreateRequestParameters(
                commonParameters,
                requestContext,
                _confidentialClientApplication.UserTokenCacheInternal);

            requestParams.SendX5C       = onBehalfOfParameters.SendX5C;
            requestParams.UserAssertion = onBehalfOfParameters.UserAssertion;

            var handler = new OnBehalfOfRequest(
                ServiceBundle,
                requestParams,
                onBehalfOfParameters);

            return(await handler.RunAsync(cancellationToken).ConfigureAwait(false));
        }
示例#4
0
        private async Task <AuthenticationResult> AcquireTokenOnBehalfCommonAsync(Authenticator authenticator, string[] scope, UserAssertion userAssertion, string policy)
        {
            var handler = new OnBehalfOfRequest(this.GetHandlerData(authenticator, scope, policy, this.UserTokenCache), userAssertion);

            return(await handler.RunAsync());
        }