public async Task CanStoreComplexClient(NpgsqlClientStore store, Fixture fixture, string clientId)
            {
                // Given
                var client = new Client
                {
                    ClientId = clientId,
                    ClientSecrets = fixture.Create<List<ClientSecret>>(),
                    Flow = Flows.AuthorizationCode,
                    Claims = new List<Claim> { new Claim(fixture.Create("type"), fixture.Create("value"))},
                    AccessTokenType = AccessTokenType.Jwt,
                    ClientUri = fixture.Create<string>(),
                    ClientName = fixture.Create<string>(),
                    RequireConsent = false,
                    ScopeRestrictions = fixture.Create<List<string>>(),
                    LogoUri = fixture.Create<string>(),
                    Enabled = true,
                };

                // When
                await store.AddClientAsync(client);

                // Then
                var fromDb = await store.FindClientByIdAsync(clientId);
                fromDb.ShouldNotBe(null);

                fromDb.ClientId.ShouldBe(clientId);
                fromDb.ClientSecrets.Count.ShouldBe(client.ClientSecrets.Count);
                fromDb.Flow.ShouldBe(client.Flow);
                
            }
Example #2
0
            public async Task CanStoreComplexClient(NpgsqlClientStore store, Fixture fixture, string clientId)
            {
                // Given
                var client = new Client
                {
                    ClientId      = clientId,
                    ClientSecrets = fixture.Create <List <Secret> >(),
                    Flow          = Flows.AuthorizationCode,
                    Claims        = new List <Claim> {
                        new Claim(fixture.Create("type"), fixture.Create("value"))
                    },
                    AccessTokenType = AccessTokenType.Jwt,
                    ClientUri       = fixture.Create <string>(),
                    ClientName      = fixture.Create <string>(),
                    RequireConsent  = false,
                    LogoUri         = fixture.Create <string>(),
                    Enabled         = true,
                };

                // When
                await store.AddClientAsync(client);

                // Then
                var fromDb = await store.FindClientByIdAsync(clientId);

                fromDb.ShouldNotBe(null);

                fromDb.ClientId.ShouldBe(clientId);
                fromDb.ClientSecrets.Count.ShouldBe(client.ClientSecrets.Count);
                fromDb.Flow.ShouldBe(client.Flow);
            }
            public async Task CanStoreSimpleClient(NpgsqlClientStore store, string clientId)
            {
                // Given
                var client = new Client()
                {
                    ClientId = clientId
                };

                // When
                await store.AddClientAsync(client);

                // Then
                var fromDb = await store.FindClientByIdAsync(clientId);
                fromDb.ShouldNotBe(null);

                fromDb.ClientId.ShouldBe(client.ClientId);
            }
Example #4
0
            public async Task CanStoreSimpleClient(NpgsqlClientStore store, string clientId)
            {
                // Given
                var client = new Client()
                {
                    ClientId = clientId
                };

                // When
                await store.AddClientAsync(client);

                // Then
                var fromDb = await store.FindClientByIdAsync(clientId);

                fromDb.ShouldNotBe(null);

                fromDb.ClientId.ShouldBe(client.ClientId);
            }