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

Problem if CheckSessionIFrame.js post message to session iframe that is not loaded yet #303

Closed
pawepaw opened this issue Apr 1, 2017 · 3 comments · Fixed by #304
Closed
Labels
Milestone

Comments

@pawepaw
Copy link
Contributor

pawepaw commented Apr 1, 2017

I got error message in console from time to time.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://localhost:44304') does not match the recipient window's origin ('https://localhost:4200').

Where:
https://localhost:44304 - identityServer address.
https://localhost:4200 - server address.

After some investigation i found out that this error may occur if you try to post mesage to iframe that is not loaded yet - stack link i found http://stackoverflow.com/a/22379990/1318210

I've manually delayed check session by putting breakpoint in identityServer code and i got same error so probably that's the case. I didn't find any code that waits for frame to be fully loaded so it could be easily fixed with delaying posting message to iframe till it fully loads. I'll create PR for it in a minute.

pawepaw pushed a commit to pawepaw/oidc-client-js that referenced this issue Apr 1, 2017
brockallen added a commit that referenced this issue Apr 1, 2017
fixes #303. start monitoring session after session iframe is fully loaded
@brockallen brockallen modified the milestones: 1.3.0, 1.3.1 Apr 1, 2017
@brockallen
Copy link
Member

Thanks!

@ryanbuening
Copy link

I'm still getting this error when using 1.5.2. It doesn't happen all the time, but this error gets logged to the console occasionally:

oidc-client.min.js Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://idsrv.domain.com') does not match the recipient window's origin ('http://localhost:5000').

Doesn't appear to cause any major issues though.

@progmars
Copy link

progmars commented Aug 30, 2019

The same for me - occasional error without any noticeable side-effects. Just annoying to sometimes see this red message in the console and not being able to debug and fix it.

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

Successfully merging a pull request may close this issue.

4 participants