Esempio n. 1
0
        public RevocationRequestValidation()
        {
            _refreshTokens = new InMemoryRefreshTokenStore();
            _tokenHandles  = new InMemoryTokenHandleStore();
            _clients       = new InMemoryClientStore(TestClients.Get());

            _validator = new TokenRevocationRequestValidator();
        }
Esempio n. 2
0
        public static AuthorizeRequestValidator CreateAuthorizeRequestValidator(
            IdentityServerOptions options            = null,
            IScopeStore scopes                       = null,
            IClientStore clients                     = null,
            IUserService users                       = 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 DefaultRedirectUriValidator();
            }

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

            var mockSessionCookie = new Mock <SessionCookie>((IOwinContext)null, (IdentityServerOptions)null);

            mockSessionCookie.CallBase = false;
            mockSessionCookie.Setup(x => x.GetSessionId()).Returns((string)null);

            return(new AuthorizeRequestValidator(options, clients, customValidator, uriValidator, scopeValidator, mockSessionCookie.Object));
        }
Esempio n. 3
0
 public static IClientStore CreateClientStore()
 {
     return(new InMemoryClientStore(TestClients.Get()));
 }