开发者

OpenID login in GMail contextual gadget using GWT

What you usually do in a GWT application to sign in using OpenID is the following:

LoginInfo loginInfo = new LoginInfo();
UserService userService = UserServiceFactory.getUserService();
loginInfo.setLoginUrl(userService.createLoginURL(returnToUrl));
return loginInfo();

Where returnToUrl is the current URL you like to redirect back after verification. This works fine, if returnToUrl is a simple URL like http://mydomain.com/go/here

But as my application runs as a GMail contextual gadget, it is wrapped in a frame that gets its content from a google proxy (googleusercontent.com). So this is the - a little mor complexe - URL within the frame I like to redirect back to:

https://jtphjhg2q9h3ul31ifsbvm5hv7717h49-a-gm-opensocial.googleusercontent.com/gadgets/ifr?url=http%3A%2F%2Fgorgactsgadget.appspot.com%2Fgorgadget%2Fcom.innubili.gorgacts.client.Gorgadget.gadget.xml&container=gm&view=card

During the OpenID registration the user gets redirected several time and if the returnToUrl is not properly url encoded parts of it get lost.

As I found out here, you even in some cases have to double-encode the URL. But this time I'm not able to encode the URL correctly.

So, my questions:

  • Do you have any hints what an OpenID-retu开发者_运维百科rn-to-URL should look like in a Gmail contextual gadget?

  • Or maybe a little simpler question: Is there any other way, I can retrieve the email of the current logged in GMail user?


You cannot use openId login from within a Gadget because your gadget is proxied by the gadget container. You have to open up a popup window to do the openId login and associate the opensocialId to your openId identity on the server. You have to persist the relation between openSocialId and the user identity on the server. From then on, the gadget knows its identity by requesting the relation of its opensocialId.

see also http://code.google.com/googleapps/marketplace/best_practices.html#gadget_sso

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜