Identityserver4 使用oidc客户端的identity server 4中的post_logout_redirect_uri为空
我使用的Identity server 4的最低配置是内存中有客户端(JavaScript客户端)。 并使用oidc-client.js连接到ID4服务器,我遵循ID4提供的用于注销的示例 但在我们现有项目和注销中使用的同一个库无法从logoutId填充“PostLogoutRedirectUri”和“clientName”,因此注销后我们无法重定向回原始应用程序的页面Identityserver4 使用oidc客户端的identity server 4中的post_logout_redirect_uri为空,identityserver4,Identityserver4,我使用的Identity server 4的最低配置是内存中有客户端(JavaScript客户端)。 并使用oidc-client.js连接到ID4服务器,我遵循ID4提供的用于注销的示例 但在我们现有项目和注销中使用的同一个库无法从logoutId填充“PostLogoutRedirectUri”和“clientName”,因此注销后我们无法重定向回原始应用程序的页面 var config = { authority: "https://lo
var config = {
authority: "https://localhost:44374",
client_id: "JsClient",
redirect_uri: "https://localhost/<myexistingapp>/callback.html",
response_type: "code",
scope: "openid profile Api.read Api.write",
post_logout_redirect_uri: "https://localhost/<myexistingapp>/Home/Index",
};
var mgr = new Oidc.UserManager(config);
唯一的区别是上述方法是在jquery的DocumentReady方法下定义的
[$(文档).ready((函数(){…)
与它工作的示例应用程序相比
因此,在登录后的现有应用程序中,我们重定向到MVC路由,然后再次注销,返回到启动登录的初始页面,以便准备user manager对象。
然后调用signout函数
虽然在这里它填充loginId,但是当它提取出客户端名称和PostLogoutRedirectUri的信息时,内部代码是空的…不确定这些信息在哪里丢失
**我缺少什么或需要做什么**
客户定义为
new Client
{
ClientId = "JsClient",
ClientName = "JavaScript Client",
AllowedGrantTypes = GrantTypes.Code,
RequireClientSecret = false,
RedirectUris = { "https://localhost/<myexistingapp>/callback.html"},
PostLogoutRedirectUris = { "https://localhost/<myexistingapp>/Home/Index" },
AllowedCorsOrigins = { "https://localhost" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"Api.read",
"Api.write"
},
},
新客户端
{
ClientId=“JsClient”,
ClientName=“JavaScript客户端”,
AllowedGrantTypes=GrantTypes.Code,
RequireClientSecret=false,
重定向URI={”https://localhost//callback.html"},
PostLogoutRedirectUris={”https://localhost//Home/Index" },
AllowedCorsOrigins={”https://localhost" },
允许范围=
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
“Api.read”,
“Api.write”
},
},
new Client
{
ClientId = "JsClient",
ClientName = "JavaScript Client",
AllowedGrantTypes = GrantTypes.Code,
RequireClientSecret = false,
RedirectUris = { "https://localhost/<myexistingapp>/callback.html"},
PostLogoutRedirectUris = { "https://localhost/<myexistingapp>/Home/Index" },
AllowedCorsOrigins = { "https://localhost" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
"Api.read",
"Api.write"
},
},