authority: "http://192.168.1.50:2000", //授权新中心
授权地址用本址localhost使用没有问题,但如果使用192.168.1.50的服务器,在callback页面上就会报错:Error: No matching state found in storage
at OidcClient.js:121
<template></template>
<script>
import Oidc from "oidc-client";
import { UserManager } from "oidc-client";
const userManagerConfig = {
client_id: "localadmin", //storeadmin
redirect_uri: `http://localhost:8080/callback.html`,
response_type: "code",
scope:
"openid profile master notification article catalog message filemanagement",
authority: "http://192.168.1.50:2000", //授权新中心
silent_redirect_uri: `http://localhost:8080/silentRenews.html`,
automaticSilentRenew: true,
filterProtocolClaims: true,
loadUserInfo: true,
monitorSession: true,
};
var manager = new UserManager(userManagerConfig);
export default {
beforeCreate() {
manager.signinRedirect();
},
};
</script>
callback.html
new Oidc.UserManager({ response_mode: "query" }).signinRedirectCallback().then(function () {
window.location = "/";
}).catch(function (e) {
console.error(e); //此处获取到错误信息:Error: No matching state found in storage
at OidcClient.js:121
});
原来是因为时间的问题,我的服务器时间不正确。。
你好,我也遇到类似的问题了,本地vue项目,id4服务在服务器上,id4的客户端绑定的是localhost:8080,本地vue项目也是8080,能跳转回来,但是立刻就闪退,后端日志:Showing login: User is not authenticated,请问是什么原因呢