Hash not being cleared after silent refresh in Firefox
See original GitHub issueIn Firefox, when the token is refreshed by silent refresh, it adds a # automatically in the url and it’s not removed from the url.
It only happens in Firefox, I don’t have the issue in Chrome.
I even tried to add clearHashAfterLogin: true
but it doesn’t seem to do anything, the hash is not removed.
I’m using angular-oauth2-oidc(v4.0.2) with Keycloak (4.2.1.Final). I use the default routing configuration in Angular, so my URLs don’t contain any hash.
My auth.config.ts
export const authConfig: AuthConfig = {
// Url of the Identity Provider
issuer: 'http://keycloak.local/auth/realms/helloworld',
requireHttps: false,
// URL of the SPA to redirect the user to after login
redirectUri: window.location.origin + '/index.html',
// URL for silent refresh
silentRefreshRedirectUri: window.location.origin + '/silent-refresh.html',
// Timeout before silent refresh is fired, 0.4 => fired when access token expiration time reaches 40%
timeoutFactor: 0.5,
showDebugInformation: true,
// The SPA's id. The SPA is registerd with this id at the auth-server
clientId: 'my-app',
scope: 'openid profile email',
};
My app.component.ts
export class AppComponent {
title = 'app';
constructor(private oauthService: OAuthService) {
this.configureWithNewConfigApi();
}
private configureWithNewConfigApi() {
this.oauthService.configure(authConfig);
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
this.oauthService.loadDiscoveryDocumentAndLogin();
this.oauthService.setupAutomaticSilentRefresh();
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:15
Top Results From Across the Web
Auto Refresh Page – Get this Extension for Firefox (en-US)
Auto Refresh Page is a browser extension that automatically refreshes and reloads any page or tab after a specified number of seconds.
Read more >window.location.reload not working for Firefox and Chrome
I want to change the user status on click of a Button, so all I am doing is, detecting the current status and...
Read more >Microsoft Edge Browser Policy Documentation
Windows and Mac documentation for all policies supported by the Microsoft Edge Browser.
Read more >Safari Technology Preview Release Notes - Apple Developer
Changed to check for overflow content after trimming trailing content ... Fixed Web Locks held in a Worker not getting released on page...
Read more >Firefox/Tweaks - ArchWiki - Arch Linux
In about:config set network.protocol-handler.expose.magnet to false . In case it does not exist, it needs to be created, right click on a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I understand. Thank you for your help 😄
I tried on Ubuntu 16.04 and 18.04 and these versions:
I get the hash as soon as I click on force silent refresh.
If you have Docker installed, you can run the following container
docker run --rm -it -p 4200:80 tazounet/sample-angular-oauth2-oidc