Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Event on silent renew failure #934

Closed
mustafakachwala opened this issue Jan 9, 2021 · 4 comments
Closed

No Event on silent renew failure #934

mustafakachwala opened this issue Jan 9, 2021 · 4 comments

Comments

@mustafakachwala
Copy link

Hi Damien,

I had a question, I am using Code Flow with PKCE with silent renew in an Iframe. Our Auth server is having a 4 hour session and our token has 1 hour lifespan. Hence, our silent renew works fine for this duration. Once the session on server is expired, the call to silent renew fails with an error code. I am not able to get any event for this call failure. When enabling the logs, I see that silent renew is setup and the event is fired for refresh. But as that call has failed. the silent renew just logs as finished and the tokens are not renewed. Would you suggest how I can handle this scenario?

@damienbod
Copy link
Owner

damienbod commented Jan 10, 2021

Hi @mustafakachwala

When the server session resets, you must login again. The silent renew fails which is good. The IsAuthorized obserable is triggered and set to false. Could you react to this event?

Greetings Damien

@mustafakachwala
Copy link
Author

@damienbod thanks for your response.

I went through the code and what I think could be a problem is that once the url for silent renew is sent, the auth lib expects a return url with either the code or error as a param in the URL. In my case, there is no return, because the call sent to silent renew fails. The silent renew finishes because it has sent the request.

In this image, the API call which is logged is actually failed with error code 401
image
But the logs just print that silent renew was complete and periodic check completed.

I will check with our auth team to see if they can send us a 200 even if silent renew fails along with an error in the return url.

But on the lib side, should we have something like a timeout to check for the return url after silent renew is triggered. If we do not receive a return after say x seconds, we just fail and send an event to required subscribers.

@damienbod
Copy link
Owner

@mustafakachwala Does the PR from @Expelz help you solve you problem? If so we can close this.

Greetings Damien

@mustafakachwala
Copy link
Author

Thanks @damienbod and @Explez, yes this does solve my problem. We can close this. Thanks once again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants