Embedding login with microsoft in an iFrame?

Viewed 2291

Integration: Load an SPA in InContact inside of an iFrame.

We have our ADFS setup on Microsoft Azure. We have an SPA that initiates SSO flow for ADFS with Azure from the backend. How: the backend responsible for rendering index.html for SPA first redirects to IDP metadata_url which once successful redirects to our login with token in the url.

What I've tried: - Remove the X-Frame-Options header, so our SPA can load into the InContact iFrame. - This enables me to load our SPA into iFrame - I tried the dirty approach of setting the X-Frame-Options header to use allow-from (yes, it is deprecated), but with that there are issues with PowerShell. Using the command:

as mentioned here

Its response is:

PS /home/dhruv> Set-AdfsResponseHeaders -SetHeaderName "X-Frame-Options" -SetHeaderValue "allow-from https://*.mpulsemobile.com"
Set-AdfsResponseHeaders: The term 'Set-AdfsResponseHeaders' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  • Tried posting to Microsoft forums here, but that gets me into a redirect loop!

So my question is: Is there another easy way to set the header X-Frame-Options of the IDP url (login.microsoftonline.com//) to allow iFrame embedding or a better way to approach this?

1 Answers

X-Frame-Options is not deprecated for ADFS, and can be used as stated "in certain rare cases you may trust a specific application that requires iFrame capable interactive AD FS login page. The ‘X-Frame-Options' header is used for this purpose".

Ensure you're runnig the cmdlet from the AD FS server, also if its 2016 that KB4493473 and KB4507459 have been applied. Finally that the ADFS module has been loaded:

(Get-Module ADFS) -ne $null (should output True)

If not manually load it:

Import-Module ADFS (should not throw an errorr)

If that fails ensure the files are available and let us know:

Test-Path C:\Windows\system32\WindowsPowerShell\v1.0\Modules\adfs\adfs.psd1 (should return True)
Related