Open thekalinga opened 7 years ago
Here is the complete OAuth2 flow
Sure, I'll try to put an example to describe this case, as it's quite complex.
I'll think more about it when I have more time, but I think the way to go is that all this flow is managed by an interceptor, call him "AuthInterceptor". Then in interceptAfter
(where we get the response from the server) we can check for OAuth token expired. If it has, then we can send another request from the same interceptor to renew the token, because we can actually return a Observable<InterceptedResponse>
on interceptAfter
, allowing us to do async stuff inside.
I still have to create some usage examples, and this one looks great to start with.
Can u add an example to the readme on how to do retry. For eg., in
OAuth2
, when a request is made, if theauth token
has expired, the client (browser) needs to refresh auth token usingrefresh token
& make a new request for the previous failed call using thisnew auth token
If for some reason, both auth & refresh tokens are expired, the user needs to be sent to login page.
Can you update the documentation to reflects flows of this nature