Esempio n. 1
0
        public static IdentityServerServiceFactory Configure()
        {
            var factory = new IdentityServerServiceFactory();

            var scopeStore = new InMemoryScopeStore(Scopes.Get());

            factory.ScopeStore = new Registration <IScopeStore>(scopeStore);
            var clientStore = new InMemoryClientStore(Clients.Get());

            factory.ClientStore = new Registration <IClientStore>(clientStore);

            factory.CorsPolicyService = new Registration <ICorsPolicyService>(new DefaultCorsPolicyService {
                AllowAll = true
            });

            return(factory);
        }
Esempio n. 2
0
        public static IdentityServerServiceFactory Configure(string connString)
        {
            var efConfig = new EntityFrameworkServiceOptions
            {
                ConnectionString = connString,
            };

            // these two calls just pre-populate the test DB from the in-memory config
            ConfigureClients(Clients.Get(), efConfig);
            ConfigureScopes(Scopes.Get(), efConfig);

            var factory = new IdentityServerServiceFactory();

            factory.RegisterConfigurationServices(efConfig);
            factory.RegisterOperationalServices(efConfig);

            return(factory);
        }
Esempio n. 3
0
        public static IdentityServerServiceFactory Configure()
        {
            var factory = new IdentityServerServiceFactory();

            var scopes = Scopes.Get().ToList();

            scopes.ForEach(s => s.IncludeAllClaimsForUser = true);

            var scopeStore = new InMemoryScopeStore(scopes);

            factory.ScopeStore = new Registration <IScopeStore>(scopeStore);
            var clientStore = new InMemoryClientStore(Clients.Get());

            factory.ClientStore = new Registration <IClientStore>(clientStore);

            factory.CorsPolicyService = new Registration <ICorsPolicyService>(new DefaultCorsPolicyService {
                AllowAll = true
            });

            return(factory);
        }