maxmantz/redux-oidc

processSilentRenew() not executed on token expire

thidasapankaja opened this issue · 5 comments

I've configured redux-oidc with react-boilerplate project. I've set automaticSilentRenew true. And I have a folder named silent and there's index.js with

import { processSilentRenew } from 'redux-oidc';

processSilentRenew();

and silent.html with

<!DOCTYPE html>
<html lang="en">
<body>

</body>
</html>

in it. I configured the the js file and index file in webpack as well. When I first start the project
processSilentRenew(); executes and project loads. But after the timeout, processSilentRenew(); is not executing. What maybe the reason ? How can I catch an error or something and figure out the reason ?

Any help would be appreciated.

Thanks

Hi. From the info you've provided it is difficult to say what the issue is. In addition to the steps you've provided you have to make sure that you set the config value silent_redirect_uri to the path where your silent.html is located. Also make sure that webpack bundles silent.html correctly, since this can be quite tricky.

Other than that I cannot say why this isn't working. You could enable logging for the userManager by running this:

import { Log } from "oidc-client";
Log.logger = console;

Maybe this will give you additional pointers on where to look for troubleshooting.

@maxmantz ,

Thank you.
I configured the log and I'm getting these errors on the log after USER_EXPIRING action is dispatched.

Frame window timed out
SilentRenewService._tokenExpiring: Error from signinSilent: Frame window timed out

What I'm seeing is my app is not dispatching redux-oidc/LOADING_USER action. Should I dispatch it manually ? I've configured the reducer.

This usually hints at something wrong with the bundling of silent.html. There are two ways to verify this. In Chrome's devtools when you instpect the HTML, can you see an <iframe /> in the markup? This is where silent.html gets loaded into. When there is an error there, this is why the log message appears. In addition, please check your production build and the files generated by webpack. Is there a silent.html in the same folder as the index.html?

Closing this for now. If you have further questions, feel free to comment.

@thidasapankaja I am beginner in Javascript. My Project is also using React boilerplate. Can you please help me on how to configure silent_renew html and js file in webpack.