[英]IdentityServer4 Configuration Issue
我正在將IdentityServer4添加到.net core 2.1應用程序中,並且在注銷時遇到問題,這使我遇到了總體結構問題。
從所有示例中,我可以發現客戶端具有與其選項不同的RedirectUris和PostLogoutRedirectUris端口.Authority是。
例如,我的父親是:
public static IEnumerable<Client> GetClients()
{
return new List<Client> {
new Client {
ClientId = "oauthClient",
ClientName = "Example Client Credentials Client Application",
AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets = new List<Secret> {
new Secret("superSecretPassword".Sha256())},
AllowedScopes = new List<string> {"customAPI.read"}
},
new Client {
ClientId = "openIdConnectClient",
ClientName = "Example Implicit Client Application",
AllowedGrantTypes = GrantTypes.Implicit,
AllowedScopes = new List<string>
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"role",
"customAPI.write"
},
RedirectUris = new List<string> {"http://localhost:5000/signin-oidc"},
PostLogoutRedirectUris = new List<string> {"http://localhost:5000"}
}
};
}
並且我的IdentityServer被設置為
services.AddAuthentication(options =>
{
options.DefaultScheme = "cookie";
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("cookie")
.AddOpenIdConnect("oidc", options =>
{
options.RequireHttpsMetadata = false;
options.Authority = "http://localhost:5000/";
options.ClientId = "openIdConnectClient";
options.SignInScheme = "cookie";
});
認為這是錯誤的,但是我不確定在設置options.Authority = "http://localhost:5001/";
時options.Authority = "http://localhost:5001/";
我認為應該從示例中做些什么,但是我得到了例外。
這可能是一個愚蠢的問題,但是我可以僅使用1個主機使用IdentityServer4,還是需要兩個?
我在理解您的問題時遇到了一些麻煩,但是我會盡力而為。
您可以在同一主機上配置身份服務器和與身份服務器一起使用的項目。
話雖如此,這實際上取決於您的意圖。 例如,如果客戶端應用程序關閉,身份服務器是否應該可用?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.