Chrome WebStore / Checking for Payment / OpenID: user.getFederatedIdentity() always returns Null

9 views
Skip to first unread message

KenOKABE

unread,
Feb 13, 2012, 4:35:54 PM2/13/12
to Chromium Apps
Chrome WebStore / Checking for Payment / OpenID Question.

Checking for Payment
http://code.google.com/chrome/webstore/docs/check_for_payment.html#userid
PROBLEM:
This walkthrough(Java sample) does not work for me,
because I cannot obtain
* a user ID for the current user (an OpenID URL corresponding to a
Google account)

Accoding to 'Identifying the User'
http://code.google.com/chrome/webstore/docs/identify_user.html#how
--'If you're writing a hosted app with Google App Engine, supporting
Google Accounts is easy. You just use the default Google Accounts API
authentication and the Users service. '
Not Exactly...
PROBLEM:
user.getFederatedIdentity() always returns Null

--'If you aren't using Google App Engine, you can get the Google
OpenID endpoint by sending a request to https://www.google.com/accounts/o8/id.
See Federated Login for Google Account Users for details.'
Ok, I use GoogeAppEngine, so I do not have to request to
https://www.google.com/accounts/o8/id, and GAE framework shall
return openID URL corresponding to gmail address via
user.getFederatedIdentity() , am I correct?

I can mangage GoogleAccount SignIn/SignOut, just cannot obtain openID.
Please help. thank you.

Ken






Ken OKABE

unread,
Feb 13, 2012, 4:55:47 PM2/13/12
to Chromium Apps
UserService userService = UserServiceFactory.getUserService();

if (!(userService.isUserLoggedIn()))
{
   output.printf("<a href=\"%s\">Sign in</a>",
userService.createLoginURL(url, null,
"https://www.google.com/accounts/o8/id",
new HashSet<String>()));

}


Also, the above code works fine on Eclipse-GAE/J local test
environment(http:/localhost:8888),
however once I deploy GAE server, Internal ServerError(500) occurs.

What's going on?

Thanks.
Ken

Ken OKABE

unread,
Feb 13, 2012, 6:49:23 PM2/13/12
to Chromium Apps
Ok, I solved the problems by myself.

http://code.google.com/appengine/articles/openid.html

I needed to configure GAE login via dashboad.
Pity the 'walkthrough' never mentions this.

Reply all
Reply to author
Forward
0 new messages