Currently, I have a GWT based application “/app.htm”
It displays an openId login button which does a
Window.Location.assign("/openidServlet?return=/app.htm")
This servlet prepares some stuff to call google’s openid page, and then goes back to the return url. This is works, but app.html also display a google maps and this is heavy when reloading.
I would like to do this in a new window (a kind of popup) to avoid reloading ‘app.htm’
In a perfect world, when openid window closes, it sends to app.htm something to say “ready, do your loginRpc query again”
I already tried to do it in a Frame but I get
Refused to display document because display forbidden by X-Frame-Options
Working with gwt2.4 and NO gae
You’d want to use the OpenID UI Extension. There’s sample code available in JavaScript, that should be relatively easy to port to GWT (or more easily wrapped, using JSNI).
Basically, it uses
window.open()to start the OpenID signing process in a popup window, and it monitors the window object (returned bywindow.open(), which requires using JSNI in GWT, ascom.google.gwt.user.client.Window#opendoesn’t return it) to see if it was closed or not (and yourreturn_topage could contain a script to automatically close the window if you like).When the popup is closed, you can retry your request, and possibly start the signing process again if you detect the user is still not logged in.
They don’t seem to be using it, but I suppose you could communicate back to your app from the
return_topage usingwindow.opener(and exposing some callback method through JSNI: https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsJSNI#calling )