Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

__zone_symbol__xhrScheduled error with silent refresh and IE/Edge #528

Closed
DevInstinct opened this issue Apr 9, 2018 · 13 comments
Closed

Comments

@DevInstinct
Copy link

DevInstinct commented Apr 9, 2018

Silent refresh works fine in Chrome/FireFox.

In IE/Edge, right after the "silent refresh" event trace in the browser, I get these errors:

SCRIPT5007: Unable to get property '__zone_symbol__xhrScheduled' of undefined or null reference
zone.js (2959,1)
ERROR TypeError: Unable to get property 'current' of undefined or null reference
SCRIPT5007: Unable to get property 'stackTraceLimit' of undefined or null referenceeval code (1466) (119,9)
SCRIPT5007: Unable to get property '__zone_symbol__xhrScheduled' of undefined or null referencezone.js (2959,1)
ERROR TypeError: Unable to get property 'current' of undefined or null reference
SCRIPT5007: Unable to get property 'stackTraceLimit' of undefined or null referenceeval code (1466) (119,9)
SCRIPT5007: Unable to get property '__zone_symbol__xhrScheduled' of undefined or null referencezone.js (2959,1)
ERROR TypeError: Unable to get property 'current' of undefined or null reference
SCRIPT5007: Unable to get property 'stackTraceLimit' of undefined or null referenceeval code (1466) (119,9)
SCRIPT5007: Unable to get property '__zone_symbol__xhrScheduled' of undefined or null referencezone.js (2959,1)
ERROR TypeError: Unable to get property 'current' of undefined or null reference
SCRIPT5007: Unable to get property 'stackTraceLimit' of undefined or null referenceeval code (1466) (119,9)
SCRIPT5007: Unable to get property '__zone_symbol__xhrScheduled' of undefined or null referencezone.js (2959,1)
SCRIPT5007: Object expectedzone.js (192,1)

Thanks for any help.

@brockallen
Copy link
Member

What was the ultimate issue?

@DevInstinct
Copy link
Author

Was getting the error with IE/Edge only, when an Angular page was set as the callback. I worked around it by using plain silent.html/silent.js pages instead.

@brockallen
Copy link
Member

brockallen commented Apr 12, 2018

Was getting the error with IE/Edge only, when an Angular page was set as the callback. I worked around it by using plain silent.html/silent.js pages instead.

This is what I recommend, because 1) the OIDC callback needs to use the hash fragment to pass params and some frameworks are a PITA with not playing nice here, and 2) I'd encourage to avoid superfluous code on the callback to avoid XSS and other possible security vulnerabilities. The callback is the very sensitive handoff from the STS back to your app.

@nchetbani
Copy link

I am getting the same error in IE/Edge as @DevInstinct when I'm using oidc-client library:

<script> new UserManager().signinSilentCallback() .then(data => { }) .catch((err) => { console.log('error'); console.log(err); }); </script>

@DevInstinct you mentioned above you used a work around silent.html/silent.js, can you please share the js file and give more information about his work around?
@brockallen I read your suggestions above, but I did not understand well. can you give an example

@DevInstinct
Copy link
Author

I configured the manager to use:
silent_redirect_uri: ${location.origin}/js/silent-refresh/silent-refresh.html,

In the plain html file I have:

<body>
    <script src="oidc-client.js"></script>
    <script src="silent-refresh.js"></script>
</body>

And silent-refresh.js contains only:

var mgr = new Oidc.UserManager();
mgr.signinSilentCallback();

@nchetbani
Copy link

Thank you @DevInstinct for your Quick Feedback !!!

I followed that, but I get the following error

SCRIPT5009: 'Promise' is undefined
File: oidc-client.min.js, Line: 1, Column: 12956
error SilentRenew
access token expired

Any idea please ?

@nchetbani
Copy link

when I try with this (in the silent-refresh.js file)

new UserManager().signinSilentCallback().then(data => { })
      .catch((err) => {
            console.log('error');
            console.log(err);
        });

I get the following error

SCRIPT1002: Syntax error
File: silent-refresh.js, Line: 3, Column: 53

@brockallen
Copy link
Member

I suspect it's due to the lambda.

@nchetbani
Copy link

Yes, it's due to the lambda, but even changing the code below (without lambda),

new UserManager().signinSilentCallback()
      .then(function(result) { })
      .catch(function(err) {
            console.log('error');
            console.log(err);
        });

I get the following erreuir

SCRIPT5009: 'Promise' is undefined
File: oidc-client.min.js, Line: 1, Column: 12956

@brockallen
Copy link
Member

brockallen commented Jan 22, 2019

So you're running in IE. You need a polyfill for Promise.

@nchetbani
Copy link

Thank you @brockallen

what do you mean by "You need a polyfill for Promise" ?

@brockallen
Copy link
Member

brockallen commented Jan 22, 2019

You need to load in a JS file in IE to substitute for the lack of Promise in IE. Google for "polyfill"

@nchetbani
Copy link

Thank you @DevInstinct and @brockallen for your assistance. It work by including the polyfill lib

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants