IdentityModel / oidc-client-js

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
Apache License 2.0
2.43k stars 840 forks source link

Silent Refresh is not working in mobile browsers(android, ios) #1341

Closed Exlord closed 3 years ago

Exlord commented 3 years ago

Hi, I have a Angular app setup with oidc, Everything is fine in desktop enviroment and silent refresh works as it should ...

But when using mobile device browsers , silent refresh does not work and the user gets logged out after the token is expired!

Is there anything happening differently when oidc detects a mobile device?

this is my config :

this._userStore   = new WebStorageStateStore({ store: window.localStorage, prefix: '_oidc_' });
    return {
      userStore                          : this._userStore,
      authority                          : environment.authUrl,
      client_id                          : "angular",
      redirect_uri                       : baseHref + '/authenticate',
      post_logout_redirect_uri           : baseHref,
      response_type                      : "code",
      scope                              : "openid profile offline_access",
      filterProtocolClaims               : true,
      loadUserInfo                       : true,
      automaticSilentRenew               : true,
      silent_redirect_uri                : baseHref + '/silent-refresh.html',
    };

Should I set some config differently in mobile browser?
This has happened in any mobile device we have tested , including both android and ios !

I am using "oidc-client": "^1.10.1"

brockallen commented 3 years ago

I don't know, sorry.

Exlord commented 3 years ago

Ok testing it shows that silent refresh is actually working while the browser is open, but if I switch to another app or close the browser and come back after a while then I have to enter the user/pass again ! ant idea on this one?