IdentityModel / oidc-token-manager

Apache License 2.0
51 stars 36 forks source link

5 seconds limit for silent nenewal of the token #40

Closed aubm closed 8 years ago

aubm commented 8 years ago

Hello,

I noticed that FrameLoader.prototype.loadAsync returns a rejected promise if the renewal of the token is not done in 5 seconds or less, even though the function is invoke a minute before token expiration.

Is there a particular reason for this behavior and, if not, maybe it would be nice to be able to change those 5 seconds using some configuration parameter ?

Aurélien.

cc @davinkevin

brockallen commented 8 years ago

The reason it's fairly short is that the silent renew should return immediately with a result (success or failure), either because the user is logged in or not. Are you having problems with it at 5s?

aubm commented 8 years ago

Hum I see, but though I wonder if 5 seconds are not a bit too short. I am not suggesting to set an unreasonably long delay, but considering the fact that the code will fetch the URL a minute before the token is expired, what about setting it to, let's say 10 or 15 seconds ?

In fact, I am a little bit suprised that nobody encountered issues about that, especially with low bandwidth devices like smartphones.

brockallen commented 8 years ago

I'm fine with that -- please send a PR with a new default. If you want, you can also add more to make it configurable.

aubm commented 8 years ago

Nice :) I'll see what I can do then.

aubm commented 8 years ago

I closed the PR because of the suspicious amount of deletions in dist/oidc-token-manager.js. I used the gulp default task to generate it, the output file is about 800 lines only. Am I missing something ?

brockallen commented 8 years ago

Well, just do the PR on the original source and I can do the build to check it.

aubm commented 8 years ago

Ok, it seems that I forgot to bower install before running gulp, my bad.

aubm commented 8 years ago

Hey ! Thank you for merging :) Could you please create a new tag for me to be able to use the new parameter in my project ?

brockallen commented 8 years ago

Tag done

aubm commented 8 years ago

Nice, thank you :)