Authentication Identity Server 4同意屏幕从不显示
我正试图让同意屏幕从, 我已将客户端配置为需要同意,如下所示:Authentication Identity Server 4同意屏幕从不显示,authentication,asp.net-core,identityserver4,Authentication,Asp.net Core,Identityserver4,我正试图让同意屏幕从, 我已将客户端配置为需要同意,如下所示: new Client { ClientId = "openIdConnectClient", ClientName = "Example Implicit Client Application", AllowedGrantTypes = GrantTypes.Implicit, RequireConsent = true, AllowedScopes =
new Client
{
ClientId = "openIdConnectClient",
ClientName = "Example Implicit Client Application",
AllowedGrantTypes = GrantTypes.Implicit,
RequireConsent = true,
AllowedScopes = new List<string>
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"role",
"customAPI"
},
RedirectUris = new List<string> {"https://localhost:44330/signin-oidc"},
PostLogoutRedirectUris = new List<string> { "https://localhost:44330" }
}
新客户端
{
ClientId=“openIdConnectClient”,
ClientName=“示例隐式客户端应用程序”,
AllowedGrantTypes=GrantTypes.Implicit,
RequireSent=true,
AllowedScopes=新列表
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
“角色”,
“自定义API”
},
重定向URI=新列表{”https://localhost:44330/signin-oidc“},
PostLogoutRedirectUris=新列表{”https://localhost:44330" }
}
该项目包含同意屏幕的控制器和视图,但我无法加载它。如果需要,我可以显示类或视图以获得同意
有人知道如何配置IdentityServer 4以显示同意屏幕吗?注册OpenIDConnect方案时,通过设置提示符属性,可以强制在客户端中始终显示同意屏幕:
.AddOpenIdConnect(options =>
{
options.Authority = "https://localhost:6001";
options.ClientId = "xxx";
options.ClientSecret = "xxxx";
options.ResponseType = "code";
...
options.Prompt = "consent";
});
我假设登录过程确实有效,您只是没有得到作为过程一部分显示的同意?您是否可以提供登录过程中生成的Identity Server日志?在为DI容器设置ID时,您是否配置了ID的同意URL?是否有一个控制器负责该url?有一个控制器负责,但我看不到它在任何地方被引用。我不确定你应该在哪里使用持久存储?可能已存储同意决定。是否尝试将调试点放在同意控制器的索引操作中?