Emit "silent_refresh_timeout" error event during 5 -> 10 minutes
See original GitHub issue- When I come back my page duration is 5 => 10 minutes, a error raises like bellow:
- refresh error OAuthErrorEvent {type: “silent_refresh_timeout”, reason: null, params: null}.
-
Can you can help me fix it and explain why? thanks so much
-
this is my config:
export const authConfig: AuthConfig = {
// Url of the Identity Provider issuer: BaseHostConstant.authorityUrl,
// URL of the SPA to redirect the user to after login
redirectUri: ${BaseHostConstant.baseUrl}login
,
// URL of the SPA to redirect the user after silent refresh
silentRefreshRedirectUri: ${BaseHostConstant.baseUrl}silent-refresh
,
// The SPA’s id. The SPA is registerd with this id at the auth-server clientId: BaseHostConstant.ssoClientId,
responseType: ‘id_token token’,
oidc: true,
// set the scope for the permissions the client should request // The first three are defined by OIDC. The 4th is a usecase-specific one scope: ‘openid profile email roles hrtoolInternalApi organization’,
showDebugInformation: true,
sessionChecksEnabled: true,
// redirect to login after logout postLogoutRedirectUri: BaseHostConstant.baseUrl,
// timeoutFactor: 0.002 };
private oauthConfigure() { this.oauthService.configure(authConfig); this.oauthService.tokenValidationHandler = new JwksValidationHandler(); this.oauthService.loadDiscoveryDocumentAndTryLogin();
const loginOptions = new LoginOptions();
loginOptions.disableOAuth2StateCheck = true;
this.oauthService.loadDiscoveryDocumentAndLogin(loginOptions).then((res) => {
if (!this.authService.isAuthenticated) {
this.oauthService.silentRefresh();
}
});
}
Component({ template: `` }) export class SilentRefreshComponent implements OnDestroy { private timer;
constructor(private authService: OAuthService) {
this.timer = setTimeout(() => {
this.oauthService.silentRefresh();
}, 30000);
}
ngOnDestroy() {
clearTimeout(this.timer);
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
I have made everything as described here https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/refreshing-a-token-(silent-refresh).html, but still no success. The token gets updated, but the error does not disappear.
Thanks.
You have to consider the following:
Details can be found here: https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/refreshing-a-token-(silent-refresh).html
In Angular 6 you have to add the
src
folder when setting up the assets: