how to get unique identity from users logged in with open id google app engine

10 views
Skip to first unread message

Saad Attieh via StackOverflow

unread,
Jul 3, 2014, 9:06:50 PM7/3/14
to google-appengin...@googlegroups.com

I have just come across Google App engine and am trying to develop a site on it. Part of the site should allow users to log in. I plan to offer two options.

  1. log in using my own implemented account manager with sessions and whatnot - not to hard according to this SO question
  2. Log in using an open ID account

When using my own log in form I can force a unique identity to be created through an email address/user name field, etc. but how can I get a unique identity from an open id user? Are they guarantied to have supplied an email - as in will the user service give me a user object that is guarantied to have an email?

Thanks a lot for any advice



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/24565362/how-to-get-unique-identity-from-users-logged-in-with-open-id-google-app-engine

pgiecek via StackOverflow

unread,
Jul 4, 2014, 6:12:11 AM7/4/14
to google-appengin...@googlegroups.com

To get the unique identifier for a user, use User#getUserId().

Returns an opaque string that uniquely identifies the user represented by this User object.

In case of open ID account, you can also use User#getFederatedIdentity(), however, I would say that it does not have to return always the unique identifier.

There are two flavors of provider types: direct providers like Google and Yahoo! require only a generic federated identity that has no username associated with it.

In contrast, Flickr, WordPress, Blogger, and LiveJournal are known as username providers because all require you to provide a URL which does.

See more details here.

Anyway there is also a possibility to store the user object as a whole. This is supported out of the box by App Engine and Datastore.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/24565362/how-to-get-unique-identity-from-users-logged-in-with-open-id-google-app-engine/24571872#24571872
Reply all
Reply to author
Forward
0 new messages