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

Silent renew of tokens do not work #1368

Open
nandeeshwar-p opened this issue May 15, 2024 · 5 comments
Open

Silent renew of tokens do not work #1368

nandeeshwar-p opened this issue May 15, 2024 · 5 comments

Comments

@nandeeshwar-p
Copy link

I am using latest version of the package @axa-fr/react-oidc.

My requirement is to refresh access and I'd tokens, before the session expires if the user is actively using the application.

So, as pert of oidc configuration I have added refresh_time_before_tokens_expiration_in_second:300,
and token_automatic_renew_mode:TokenAutomaticRenewMode.AutomaticBeforeTokensExpiration, even then the token renew doesn't happen silently, instead after session expiry, "Session lost" component is rendered.

I tried with service worker and without service worker, either way it didn't help.

Could you please let me know how to renew tokens(with/out sevice worker) without disturbing user activity

@guillaume-chervet
Copy link
Contributor

hi @nandeeshwar-p ,

thank you for your issue. DO you have a sample of your configuration?

To refresh token, you should avec scope : access_offline or use silent signin.

@guillaume-chervet
Copy link
Contributor

hi @nandeeshwar-p you manage to make it works?

@nandeeshwar-p
Copy link
Author

@guillaume-chervet thanks for the response... How do we use silent signin, could you please share the example link or a code snippet....

@guillaume-chervet
Copy link
Contributor

Hi @nandeeshwar-p , did you tried the demo?
https://github.com/AxaFrance/oidc-client/blob/main/examples%2Freact-oidc-demo%2Fsrc%2FMultiAuth.tsx

It contains many example. Which framework are you using?

@nandeeshwar-p
Copy link
Author

Code snippet related to my implementation





With this in palce, a call is made to fetch token with the code as null,and eventually it fails

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