静默刷新 - 使用隐式流时刷新访问令牌不适用于自定义登录 URL



>我在Angular中使用IdentityServer4(.NET Core API(和'oidc-client',其中我使用自定义登录和注销网址,而不是默认的identityserver4网址,所以在这种情况下,来自'oidc-client'的静默刷新请求。 它返回 302,令牌有时自动过期

身份服务器 4:

services.AddIdentityServer(opt =>
{
opt.UserInteraction.LoginUrl = "/User/Login";
opt.UserInteraction.LogoutUrl = "/User/Logout";
opt.Events.RaiseErrorEvents = true;
opt.Events.RaiseFailureEvents = true;
opt.Events.RaiseInformationEvents = true;
opt.Events.RaiseSuccessEvents = true;
})

OIDC客户端:

getClientSettings(): UserManagerSettings {
return {
authority: localStorage.getItem('authorizationRoot'),
client_id: 'MileTMSAngapp',
redirect_uri: localStorage.getItem('redirectUri'),
post_logout_redirect_uri: 
localStorage.getItem('postLogoutRedirectUri'),
response_type: 'id_token token',
scope: 'openid profile MileTMS',
filterProtocolClaims: false,
loadUserInfo: true,
automaticSilentRenew: true,
silent_redirect_uri: localStorage.getItem('silentRedirectUri')
};
}

"静默回调":

return this.manager.signinSilentCallback()
.then(doSomething => 'done');

您在控制台中看到哪种错误?

以您提供的最少信息,我猜您正面临此问题。希望这有所帮助。

身份服务器会话 cookie 未滑动

最新更新