1

I am using angular-oauth2-oidc in my ionic 4 app and wanted to know if there is a way to implement silent logout since I couldn't find it in the angular-oauth2-oidc docs.

Shadab Umer
  • 173
  • 3
  • 12
  • What do you mean with"silent" logout? What makes it different from calling the `logOut()`method? – Christoph Lütjen Jul 20 '21 at 08:54
  • @ChristophLütjen - What I meant to say was when the token expires the app should log out automatically, instead I'm seeing requests with 401 errors. Should I explicitly call logOut() on 401 error in an interceptor? – Shadab Umer Nov 22 '21 at 07:25

1 Answers1

0

If you call .logout(...)

  • either while logoutUrl isfalsy (it's an OAuthConfig option I believe);
  • or with false as a parameter for noRedirectToLogoutUrl

then the library won't redirect you to the identity server making it a "silent" (but client-side only!) logout.

There's nothing in the library for then also logging out on the identity server, for example I don't think "backchannel logout" is supported. You'd have to write something for that yourself.

Jeroen
  • 60,696
  • 40
  • 206
  • 339