Retrieve appengine admin user profile

33 views
Skip to first unread message

Jagath Weerasinghe

unread,
Jun 23, 2020, 3:14:48 PM6/23/20
to Google App Engine
Hi All, 

I would like to know how to retrieve the complete user profile, including the first name and last name, of the currently logged in appengine admin user. Using OauthService (com.google.appengine.api.oauth and UsersService (com.google.appengine.api.users) we can retrieve the com.google.appengine.api.users.User, but it doesn't have the first name and last name. Thanks. 

Jagath

Olu

unread,
Jun 24, 2020, 11:30:21 AM6/24/20
to Google App Engine
As described in these documentation[1][2][3], you can always get information about the current user and compare the values to the user admin. 

From the return value of the users.get_current_user(), this Stackoverflow link[4] suggests that the email address of the particular user can be retrieved. However, I gathered that this may involve using APIs which involve OAuth such as these[5][6] as you have rightly alluded, to be able to get some more details from the User such as email address.

Particularly about retrieving the User's First and Last names, I understand the Python App Engine API module described here[7] is actually only used for storing User IDs as properties in your Datastore. For fetching other User details like the Last names and First names, you might need to use other APIs such as Directory API[6].

Reply all
Reply to author
Forward
0 new messages