capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular Interceptor Token Refresh

Wahsner opened this issue · comments

commented

Hello,

Looking for some advise and or a possible feature enhancement.

  • auth interceptor checks if refresh token has/is expired
  • triggers capacitor-oauth2 refreshToken method

However, how can I pause/intercept the other http request from being sent until the refresh token has been handled?
I've googled around and every example/docs I can find suggest a http subscription but the refreshToken method returns a promise.

Looking over the documentation, there isn't anyway of exposing the refresh token url (or the authentication url) or is there any it just isn't documented?

Library version:

Angular 13
Latest Ionic v5
Latest Capacitorjs
Latest Capacitor-oauth2

OAuth Provider:

  • Azure Active Directory
  • Windows Server Active Directory

I noticed this issue was closed and completed. I am trying to implement this also, what was your solution?
Thanks!