iframe and Oauth

246 Views Asked by At

i am trying to implement ohif dicom viewer inside an iframe (in an angular project) unfortunately it looks like google account refuse to work inside an iframe (Oauth is mandatory with ohif viewer) there is a way to allow oAuth inside an Iframe?

chrome err:

Refused to display 'https://accounts.google.com/' in a frame because it set 'X-Frame-Options' to 'deny'.

iframe html element:

  <iframe src="http://localhost:3000/" frameborder="4"></iframe>
1

There are 1 best solutions below

1
On BEST ANSWER

Google don’t allow their OAuth login page to be displayed in an iframe. There is nothing you can do about that.

Any OAuth provider could allow their login page to be framed, but it would not be a good idea. If a user is going to enter their Google username and password then they need to be able to trust that they are entering it on the correct site. Inside an iframe they don’t have access to the trust information displayed in the browser’s address bar.