Google App Engine - inline/iframe log-in
Is there a way to configure Google App Engine so that the log-in page appears e开发者_如何转开发ither inline or in an iframe, instead of requiring a link.
I would like it to be as simple as
<iframe src="{{ login_url }}">
<!-- no iframes -->
<a href="{{login_url}}">Log in</a>
</iframe>
However that seems to be an undocumented way to go about logging in users, and I'm not sure if that's the way to go about this.
I'd be grateful for any thoughts
Thank you for reading.
Brian
This is not a good idea. By showing a google login form on your domain how do your users know it is legitimate? By redirecting your users to a page on Google's domain it reduces the amount of confusion.
Also, you might want to review the Terms before doing this. I would not be surprised if Google specifically mentions not doing this somewhere. It's like teaching your users to give up there Google login details whenever prompted.
There have been several posts in the groups discussing this as well; Nick, and many other users, responded to this question with similar comments.
I just tried doing what you suggest here, except that I don't have the hyperlink inside of the iFrame. I want Google's authentication page to appear in the iFrame over my page rather than redirecting to the authentication page and then back to my page. I also append a query string to the login_url, and my main request then returns a simple "Welcome" message rather than my app's main page.
It works beautifully in the sandbox, but it doesn't work when deployed to GAE. The page returned by Google's login_url refuses to be displayed in an iFrame. The console message is "Refused to display document because display forbidden by X-Frame-Options." I've thought about possible workarounds, but Google obviously doesn't want the login page displayed this way. I'm disappointed, because my app uses HttpRequests heavily, so the main page never refreshes otherwise, but I'm still very happy with GAE.
精彩评论