问题描述
为什么 signoutRedirect 不起作用?
我的配置客户端
import { UserManager,WebStorageStateStore } from 'oidc-client';
const config = {
userStore: new WebStorageStateStore({ store: window.localStorage }),authority: 'http://localhost:65018',client_id: 'xxxxxxxxxxReactId',response_type: 'code',redirect_uri: "http://localhost:3000",scope: 'openid',post_logout_redirect_uri: "http://localhost:3000/logout",};
function App() {
let userManager = new UserManager(config);
const signIn = () => {
userManager.signinRedirect()
}
const logout = (e : any) => {
userManager.signoutRedirect()
}
后端
new List<Client>
{
new Client
{
ClientId = "xxxxxxxxxxReactId",ClientSecrets = {new Secret("xxxxxxxxxxSecret123".ToSha256())},AllowedGrantTypes = GrantTypes.Code,AllowedScopes = {"openid","xxxxxxxxxxApi" },RedirectUris = { "http://localhost:3000" },PostlogoutRedirectUris = { "http://localhost:3000/logout" },AllowedCorsOrigins = { "http://localhost:3000" },RequirePkce = true,RequireClientSecret = false,AllowAccesstokensViabrowser = true,RequireConsent = false,AccesstokenLifetime = 1,}
};
使用 signinRedirect 一切正常,但使用 signOut 存在一些问题。我需要 logoutId 但查询字符串为空,
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)