public AuthorizeState CreateAuthorizeState(Parameters frontChannelParameters)
        {
            _logger.LogTrace("CreateAuthorizeStateAsync");

            var pkce = _crypto.CreatePkceData();

            var state = new AuthorizeState
            {
                State        = _crypto.CreateState(_options.StateLength),
                RedirectUri  = _options.RedirectUri,
                CodeVerifier = pkce.CodeVerifier,
            };

            state.StartUrl = CreateAuthorizeUrl(state.State, pkce.CodeChallenge, frontChannelParameters);

            _logger.LogDebug(LogSerializer.Serialize(state));

            return(state);
        }
Esempio n. 2
0
        public AuthorizeState CreateAuthorizeState(IDictionary <string, string> extraParameters = default)
        {
            _logger.LogTrace("CreateAuthorizeStateAsync");

            var pkce = _crypto.CreatePkceData();

            var state = new AuthorizeState
            {
                Nonce        = _crypto.CreateNonce(),
                State        = _crypto.CreateState(),
                RedirectUri  = _options.RedirectUri,
                CodeVerifier = pkce.CodeVerifier,
            };

            state.StartUrl = CreateAuthorizeUrl(state.State, state.Nonce, pkce.CodeChallenge, extraParameters);

            _logger.LogDebug(LogSerializer.Serialize(state));

            return(state);
        }
        public AuthorizeState CreateAuthorizeState(Task <Microsoft.IdentityModel.Tokens.RsaSecurityKey> pregeneratedPoPKeyTask = null, object extraParameters = null)
        {
            _logger.LogTrace("CreateAuthorizeStateAsync");

            var pkce = _crypto.CreatePkceData();

            var state = new AuthorizeState
            {
                Nonce                  = _crypto.CreateNonce(),
                State                  = _crypto.CreateState(),
                RedirectUri            = _options.RedirectUri,
                CodeVerifier           = pkce.CodeVerifier,
                PopTokenGenerationTask = _options.RequestPopTokens ? pregeneratedPoPKeyTask ?? PopTokenExtensions.CreateProviderForPopTokenAsync() : null
            };

            state.StartUrl = CreateUrl(state.State, state.Nonce, pkce.CodeChallenge, extraParameters);

            _logger.LogDebug(LogSerializer.Serialize(state));

            return(state);
        }
        public AuthorizeState CreateAuthorizeState(object extraParameters = null)
        {
            _logger.LogTrace("CreateAuthorizeStateAsync");

            var pkce = _options.Flow != OidcClientOptions.AuthenticationFlow.Implicit ? _crypto.CreatePkceData() : null;

            var state = new AuthorizeState
            {
                Nonce        = _crypto.CreateNonce(),
                State        = _crypto.CreateState(),
                RedirectUri  = _options.RedirectUri,
                CodeVerifier = pkce?.CodeVerifier,
            };

            state.StartUrl = CreateUrl(state.State, state.Nonce, pkce?.CodeChallenge, extraParameters);

            _logger.LogDebug(LogSerializer.Serialize(state));

            return(state);
        }