Пример #1
0
 public OnBehalfOfRequest(
     IServiceBundle serviceBundle,
     AuthenticationRequestParameters authenticationRequestParameters,
     AcquireTokenOnBehalfOfParameters onBehalfOfParameters)
     : base(serviceBundle, authenticationRequestParameters, onBehalfOfParameters)
 {
     _onBehalfOfParameters = onBehalfOfParameters;
 }
 public Task <AuthenticationResult> ExecuteAsync(
     AcquireTokenCommonParameters commonParameters,
     AcquireTokenOnBehalfOfParameters onBehalfOfParameters,
     CancellationToken cancellationToken)
 {
     return(ExecuteMatsAsync(
                commonParameters,
                async() => await _executor.ExecuteAsync(commonParameters, onBehalfOfParameters, cancellationToken).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));
        }