Microsoft-authentication-library-for-js: Token renewal operation failed due to timeout: null

Created on 4 Jan 2018  路  4Comments  路  Source: AzureAD/microsoft-authentication-library-for-js

We're facing timeout errors obtaining access tokens:

Token renewal operation failed due to timeout: null

  1. Why does the error have null in it?
  2. Why isn't the timeout value configurable?
  3. Shouldn't there be some guidance/warning for this library that iframe's are used to obtain access tokens so be careful as your entire SPA app will load again (wasting a bunch of resources like RAM) so keep your startup code very light

Most helpful comment

@WardGubbi @spottedmahn You can expect to have a new version in a couple of weeks. We need to add some other features as well. @spottedmahn I will add guidance around this issue for our next release.

All 4 comments

@spottedmahn I have added the ability to make loadFrameTimeout configurable through the constructor. You can set it to 10 seconds for instance, the value should be passed in msec as follows:

var userAgentApplication = new Msal.UserAgentApplication("clientID", null, authCallback, {  loadFrameTimeout: 10000 });

For the question regarding the null value, in the current code we pass "error_description : error" as the promise value in the case of errors such as "interaction_required" or login_required" which we receive in the response from the server. For instance, see a custom response from the server when additional consent is required:

{"error":"interaction_required","error_description":"AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000002-0000-0000-c000-000000000000'.\r\nTrace ID: 7903cd61-659e-4dc6-a8b0-3dac4c672700\r\nCorrelation ID: b541777f-e2cc-4b87-ab7b-8dd83654d445\r\nTimestamp: 2017-04-18 23:02:36Z"}

For the specific edge case when we do not receive a response from the server within the default timeout value of 6 seconds, we create our custom error_description = "Token renewal operation failed due to timeout" and do not add our custom error value which leads to :null. I have modified the dev branch to pass error as "Token Renewal Failed". You should now see a promise value similar to Token renewal operation failed due to timeout:Token Renewal Failed.

I'm encountering te same issue and it is indeed resolved with this version. When can we expect this to be pushed to master and released.

Thanks for the quick turnaround @rohitnarula7176!

Thanks for making the timeout configurable and improving the error message for this case.

What about point nbr. 3?

@WardGubbi @spottedmahn You can expect to have a new version in a couple of weeks. We need to add some other features as well. @spottedmahn I will add guidance around this issue for our next release.

Was this page helpful?
0 / 5 - 0 ratings