Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
enable default client validator by default (#2525)
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen authored Aug 7, 2018
1 parent 3135a54 commit b7a860e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion host/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
.AddExtensionGrantValidator<Extensions.NoSubjectExtensionGrantValidator>()
.AddJwtBearerClientAuthentication()
.AddAppAuthRedirectUriValidator()
.AddClientConfigurationValidator<DefaultClientConfigurationValidator>()
.AddTestUsers(TestUsers.Users);

services.AddExternalIdentityProviders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public static IIdentityServerBuilder AddValidators(this IIdentityServerBuilder b
builder.Services.TryAddTransient<IResourceOwnerPasswordValidator, NotSupportedResourceOwnerPasswordValidator>();
builder.Services.TryAddTransient<ICustomTokenRequestValidator, DefaultCustomTokenRequestValidator>();
builder.Services.TryAddTransient<IUserInfoRequestValidator, UserInfoRequestValidator>();
builder.Services.TryAddTransient<IClientConfigurationValidator, NopClientConfigurationValidator>();
builder.Services.TryAddTransient<IClientConfigurationValidator, DefaultClientConfigurationValidator>();

// optional
builder.Services.TryAddTransient<ICustomTokenValidator, DefaultCustomTokenValidator>();
Expand Down
6 changes: 4 additions & 2 deletions test/IdentityServer.IntegrationTests/Clients/Setup/Clients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,15 @@ public static IEnumerable<Client> Get()
{
ClientId = "implicit",
AllowedGrantTypes = GrantTypes.Implicit,
AllowedScopes = {"api1"}
AllowedScopes = {"api1"},
RedirectUris = { "http://implicit" }
},
new Client
{
ClientId = "implicit_and_client_creds",
AllowedGrantTypes = GrantTypes.ImplicitAndClientCredentials,
AllowedScopes = {"api1"}
AllowedScopes = {"api1"},
RedirectUris = { "http://implicit_and_client_creds" }
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.


Expand Down Expand Up @@ -47,6 +47,7 @@ public RestrictAccessTokenViaBrowserTests()
{
ClientId = "client3",
AllowedGrantTypes = GrantTypes.Hybrid,
ClientSecrets = { new Secret("secret".Sha256()) },
RequireConsent = false,
AllowedScopes = new List<string> { "openid" },
RedirectUris = new List<string> { "https://client3/callback" },
Expand All @@ -56,6 +57,7 @@ public RestrictAccessTokenViaBrowserTests()
{
ClientId = "client4",
AllowedGrantTypes = GrantTypes.Hybrid,
ClientSecrets = { new Secret("secret".Sha256()) },
RequireConsent = false,
AllowedScopes = new List<string> { "openid" },
RedirectUris = new List<string> { "https://client4/callback" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.


Expand Down Expand Up @@ -58,6 +58,7 @@ public RevocationTests()
{
ClientId = "implicit_and_client_creds",
AllowedGrantTypes = GrantTypes.ImplicitAndClientCredentials,
ClientSecrets = { new Secret("secret".Sha256()) },
RequireConsent = false,
AllowedScopes = new List<string> { "api" },
RedirectUris = new List<string> { redirect_uri },
Expand Down

0 comments on commit b7a860e

Please sign in to comment.