-
Notifications
You must be signed in to change notification settings - Fork 64
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
vuexOidcProcessSilentSignInCallback issue again #125
Comments
OK, thanks for reporting! I will look at this as soon as I find the time! |
@perarnborg Thank you for response and promise to have a look :-) Just have checked a code little deeper. by this (highlighted) @perarnborg What do you think? |
@apavelm The change you suggest is actually already suggested in #123 – but I do not think that this is the cause of your problem. The callback method UserManager.signinSilentCallback of oidc-client will never throw an error – not for the automatic silent renewal or one that is manually triggered. The error when silent signin fails can only be caught in UserManager.signinSilent – like you do with the catch on the authenticateOidcSilent action in your test of manually triggering silent renewal. I see that it would be useful to be able to catch when automatic renewal is failing, but it is not possible to do this on the callback page. I am thinking of adding an event that you can listen to for this, I'll try to look into that shortly. |
@perarnborg Thank you for the fast modification. Unfortunately, it doesn't work, at least for me.
But there is no new log messages there UPDATED |
OK, looks correct to me so I will need to look at this again to see why id doesn't work. Let me know if you find anything! |
@apavelm Can you check what version of oidc-client you have installed? |
@perarnborg I did a workaround, by disabling "automatic silent renew" and listening OnTokenExpiring/OnTokenExpired to call silent renew manually (to be able to use "catch") |
I cannot reproduce this, strange that the event does not seam to be dispatched for you. I did a small alteration in v3.9.8, it might work better with that if you want to try. Anyway, if you are doing the manual renewal by dispatching the |
I did a workaround on this by disabling "auto-renew" feature + subscribing to OnTokenExpiring event to renew the token manually (because only on manual renewal I am able to catch exceptions) Thanks, anyway. Hope it will be useful for others. |
Can you tell me how you renewed the token manually? By calling a function in this library or doing the refresh request manually? I am having this issue but it works the first time and then when you refresh the page it stops working. No errors in the error events and the accessTokenExpiring/Expired still fire. I tried to use dispatch to fire 'authenticateOidcSilent' but i had to register the oidc module to the store dynamically and it couldnt find the 'authenticateOidcSilent' action and then it had a lot of issues where it couldnt find the module even though it was registered. |
I disable an auto-renewal and listening for tokenExpiring event. When it triggers, I manually call a renewal. When I do it manually I can catch exceptions. |
We figured out the issue with ours, the vuex-persist library was interfering, i excluded the vuex-oidc module from it and it worked perfectly. |
Today I gave a try to updated version (3.9.5) and faced with a strange behavior. I'm not sure that it is related to "vuex-oidc" or this is a bug of "oidc-client-js".
Given: I have an application where for testing purposes I added 2 ways of token renewal:
Here is a script on "Silent" page (silent_redirect_url):
So, I expect to see "then" in console when token renewed and "failed" otherwise.
In normal mode (no exceptions) both work fine.
But when session cookies are invalid (so we expect "catch" routing to be triggered)
Of course (2) is not applicable for automatic routing, but in the same time processSilentSignInCallback is just a
I'm confused. Any ideas why I'm still getting "OK" instead of "ERROR"?
Probably here could be a workaround, something like a watcher on oidcError, but it will not look good.
Or I'm doing something wrong? Please advise.
The text was updated successfully, but these errors were encountered: