Peter
Peter

Reputation: 11890

Obtaining Google user ID in ASP.NET MVC4

Folks,

I just started to work on an ASP.NET MVC4 web application. I added support for local login as well as login using Google ID (using OAuthWebSecurity).

It seems the user is successfully able to login using Google ID. When I examine Membership.GetUser(), I see that the user name for the logged in user is the Google email ID.

As the user can log in either locally or using Google ID, I need to have the ability to query my local database using either the local user ID or the Google ID.

I am trying to understand what Google ID is. Is it the email address of the user or is there a unique GUID associated with each Google user. I am guessing it must be the latter case. If it is, how do I obtain this Google ID? I don't see any property on Membership class that gives me this information.

Thank you in advance for your help.

Regards,
Peter

Upvotes: 0

Views: 128

Answers (1)

DfwForSale
DfwForSale

Reputation: 374

The username for google is the email address. This is an OpenID account.

Upvotes: 1

Related Questions