john2x
john2x

Reputation: 23634

Can a Gmail gadget use users.get_current_user()?

I'm trying to get the current user for a Gmail gadget, but it seems users.get_current_user() returns None, even though I'm obviously logged in.

Am I missing something?

Thanks in advance.

Upvotes: 0

Views: 348

Answers (2)

Dan Holevoet
Dan Holevoet

Reputation: 9183

You can't use the Users API directly within a Gmail gadget, but you can use a combination of OpenID and the gadgets APIs to authenticate your users. The document was writing in the context of a Gmail contextual gadget (which is installed via the Google Apps Marketplace), but the principles will still apply for non-contextual gadgets.

The biggest difference between what is outlined in the document and what happens in a non-contextual gadget is that Google Apps Marketplace applications (and their companion gadgets) are automatically whitelisted for OpenID. Without a Marketplace install, users will see an OpenID approval screen the first time they load your gadget.

Upvotes: 1

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

get_current_user returns the user who is log on into YOUR domain, in Gmail widget the user is log in into gmail.

Upvotes: 1

Related Questions