Пример #1
0
        internal static (string value, OpenIdConnectMessage error) ValidateParameterIsUnique(
            IDictionary <string, string[]> requestParameters,
            string parameterName,
            ProtocolErrorProvider provider)
        {
            if (requestParameters.TryGetValue(parameterName, out var currentParameter))
            {
                if (currentParameter.Length > 1)
                {
                    return(null, provider.TooManyParameters(parameterName));
                }

                var parameterValue = currentParameter.SingleOrDefault();
                if (string.IsNullOrEmpty(parameterValue))
                {
                    return(null, provider.MissingRequiredParameter(parameterName));
                }

                return(parameterValue, null);
            }
            else
            {
                return(null, provider.MissingRequiredParameter(parameterName));
            }
        }
Пример #2
0
 public LogoutRequestFactory(
     IRedirectUriResolver redirectUriValidator,
     ProtocolErrorProvider errorProvider)
 {
     _redirectUriValidator = redirectUriValidator;
     _errorProvider        = errorProvider;
 }
Пример #3
0
 public AuthorizationCodeIssuer(
     ITokenClaimsManager claimsManager,
     ISecureDataFormat <AuthorizationCode> dataFormat,
     ProtocolErrorProvider errorProvider)
 {
     _claimsManager = claimsManager;
     _dataFormat    = dataFormat;
     _errorProvider = errorProvider;
 }
 public TestSessionManager(
     IOptions <IdentityServiceOptions> options,
     IOptions <IdentityOptions> identityOptions,
     IOptionsSnapshot <CookieAuthenticationOptions> cookieOptions,
     ITimeStampManager timeStampManager,
     IHttpContextAccessor contextAccessor,
     ProtocolErrorProvider errorProvider) :
     base(options, identityOptions, cookieOptions, timeStampManager, contextAccessor, errorProvider)
 {
 }
Пример #5
0
 public ClientApplicationValidator(
     IOptions <IdentityServiceOptions> options,
     SessionManager sessionManager,
     ApplicationManager <TApplication> applicationManager,
     ProtocolErrorProvider errorProvider)
 {
     _options            = options;
     _sessionManager     = sessionManager;
     _applicationManager = applicationManager;
     _errorProvider      = errorProvider;
 }
Пример #6
0
 public TokenManager(
     IAuthorizationCodeIssuer codeIssuer,
     IAccessTokenIssuer accessTokenIssuer,
     IIdTokenIssuer idTokenIssuer,
     IRefreshTokenIssuer refreshTokenIssuer,
     ProtocolErrorProvider errorProvider)
 {
     _codeIssuer         = codeIssuer;
     _accessTokenIssuer  = accessTokenIssuer;
     _idTokenIssuer      = idTokenIssuer;
     _refreshTokenIssuer = refreshTokenIssuer;
     _errorProvider      = errorProvider;
 }
 public AuthorizationRequestFactory(
     IClientIdValidator clientIdValidator,
     IRedirectUriResolver redirectUriValidator,
     IScopeResolver scopeValidator,
     IEnumerable <IAuthorizationRequestValidator> validators,
     ProtocolErrorProvider errorProvider)
 {
     _clientIdValidator    = clientIdValidator;
     _redirectUrlValidator = redirectUriValidator;
     _scopeValidator       = scopeValidator;
     _validators           = validators;
     _errorProvider        = errorProvider;
 }
Пример #8
0
 public SessionManager(
     IOptions <IdentityServiceOptions> options,
     IOptions <IdentityOptions> identityOptions,
     IOptionsSnapshot <CookieAuthenticationOptions> cookieOptions,
     ITimeStampManager timeStampManager,
     IHttpContextAccessor contextAccessor,
     ProtocolErrorProvider errorProvider)
 {
     _options              = options;
     _identityOptions      = identityOptions;
     _timeStampManager     = timeStampManager;
     _contextAccessor      = contextAccessor;
     _errorProvider        = errorProvider;
     _sessionCookieOptions = cookieOptions.Get(IdentityServiceOptions.CookieAuthenticationScheme);
 }
Пример #9
0
        internal static (string value, OpenIdConnectMessage error) ValidateOptionalParameterIsUnique(
            IDictionary <string, string[]> requestParameters,
            string parameterName, ProtocolErrorProvider provider)
        {
            if (requestParameters.TryGetValue(parameterName, out var currentParameter))
            {
                if (currentParameter.Count() != 1)
                {
                    return(null, provider.TooManyParameters(parameterName));
                }

                return(currentParameter.Single(), null);
            }

            return(null, null);
        }
Пример #10
0
 public TokenRequestFactory(
     IClientIdValidator clientIdValidator,
     IRedirectUriResolver redirectUriValidator,
     IScopeResolver scopeResolver,
     IEnumerable <ITokenRequestValidator> validators,
     ITokenManager tokenManager,
     ITimeStampManager timeStampManager,
     ProtocolErrorProvider errorProvider)
 {
     _clientIdValidator    = clientIdValidator;
     _redirectUriValidator = redirectUriValidator;
     _scopeResolver        = scopeResolver;
     _validators           = validators;
     _tokenManager         = tokenManager;
     _errorProvider        = errorProvider;
     _timeStampManager     = timeStampManager;
 }