コード例 #1
0
        public static AuthorizeRequestValidator CreateAuthorizeRequestValidator(
            IdentityServerOptions options = null,
            IScopeStore scopes = null,
            IClientStore clients = null,
            IProfileService profile = null,
            ICustomRequestValidator customValidator = null,
            IRedirectUriValidator uriValidator = null,
            ScopeValidator scopeValidator = null,
            IDictionary<string, object> environment = null)
        {
            if (options == null)
            {
                options = TestIdentityServerOptions.Create();
            }

            if (scopes == null)
            {
                scopes = new InMemoryScopeStore(TestScopes.Get());
            }

            if (clients == null)
            {
                clients = new InMemoryClientStore(TestClients.Get());
            }

            if (customValidator == null)
            {
                customValidator = new DefaultCustomRequestValidator();
            }

            if (uriValidator == null)
            {
                uriValidator = new StrictRedirectUriValidator();
            }

            if (scopeValidator == null)
            {
                scopeValidator = new ScopeValidator(scopes, new LoggerFactory());
            }

            var sessionCookie = new SessionCookie(IdentityServerContextHelper.Create(null, options));

            return new AuthorizeRequestValidator(
                options,
                clients,
                customValidator,
                uriValidator,
                scopeValidator,
                sessionCookie,
                new Logger<AuthorizeRequestValidator>(new LoggerFactory())
            );
        }
コード例 #2
0
 public AuthorizeRequestValidator(
     IdentityServerOptions options, 
     IClientStore clients, 
     ICustomRequestValidator customValidator, 
     IRedirectUriValidator uriValidator, 
     ScopeValidator scopeValidator,
     SessionCookie sessionCookie,
     ILogger<AuthorizeRequestValidator> logger)
 {
     _options = options;
     _clients = clients;
     _customValidator = customValidator;
     _uriValidator = uriValidator;
     _scopeValidator = scopeValidator;
     _sessionCookie = sessionCookie;
     _logger = logger;
 }