如何在reactjs中使用PostLogoutRedirectUris?
我想使用identity server中的PostLogoutRedirectUris根据它请求的域进行重定向。我的客户端页面如下所示:-如何在reactjs中使用PostLogoutRedirectUris?,reactjs,identityserver3,Reactjs,Identityserver3,我想使用identity server中的PostLogoutRedirectUris根据它请求的域进行重定向。我的客户端页面如下所示:- new Client { Enabled = true, ClientName = "ClientA", ClientId = "ClientId", Flow = Flows.Implicit, RequireConsent = false, RedirectUris = new List<
new Client
{
Enabled = true,
ClientName = "ClientA",
ClientId = "ClientId",
Flow = Flows.Implicit,
RequireConsent = false,
RedirectUris = new List<string>
{
"http://localhost:3001/callback"
},
RequireSignOutPrompt =false,
AllowedCorsOrigins = new List<string>
{
"http://localhost:3001/"
},
PostLogoutRedirectUris=new List<string>
{
"http://localhost:3001/logout",
"http://localhost:3002/logout"
},
AllowedScopes = new List<string>
{
"openid",
"profile",
"email",
},
},
现在,如何根据reactsjs中的请求处理PostLogoutRedirectURI中的多个字符串?需要从rectajs UI传递什么信息?请帮助我。不太确定您在问什么。但是,要注销,需要调用endsession端点,将id令牌和注销后重定向url作为参数传递
/connect/endsession?id_token_hint={id token}&post_logout_redirect_uri=http://localhost:3001/logout
其中{id token}是调用/connect/authorize端点时从identity server返回的id令牌。您应该能够根据您所在的域设置post_logout_redirect_uri
请看这里的文档
请注意,您必须发送一个id令牌才能使重定向生效。我假设您已在AuthenticationOptions中将EnablePostSignOutAutoRedirect设置为true?是否有方法在PostLogoutRedirectUris中传递querystring,以便如何进行客户端匹配,因为querystring值可以更改让PostLogoutRedirectUris=新列表{http://localhost:3001/login?search= }