Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow iframe login #1198

Closed
wants to merge 2 commits into from
Closed

allow iframe login #1198

wants to merge 2 commits into from

Conversation

plessbd
Copy link
Contributor

@plessbd plessbd commented Dec 23, 2019

detect if login is within an iframe and do no redirect to the portal, instead send a postMessage to allow the parent frame to do what it wants

something like this should work

window.addEventListener("message", receiveMessage, false);

function receiveMessage(event) {
  if (event.origin !== "{FQDN OF XDMOD INSTANCE WITH PROTOCOL AND PORT IF NEEDED}"){
    console.log('Received message from untrusted origin, discarding');
    return;
  }
  if(event.data.application == 'xdmod'){
    if(event.data.message == 'loginComplete'){
      console.log('XDMoD has logged in successfully');
    }
	if(event.data.message == 'error'){
      console.log('ERROR: ' + event.data.info);
    }
  }
}

DO NOT MERGE RELATED TO #1193

@plessbd plessbd added enhancement Enhancement of the functionality of an existing feature Open OnDemand Specific changes for Open OnDemand Integration labels Jan 15, 2020
@sonarcloud
Copy link

sonarcloud bot commented Jan 15, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the functionality of an existing feature Open OnDemand Specific changes for Open OnDemand Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants