Search code examples
asp.netc#-4.0authenticationopenid

Login to ASP.net application via Google account


My client has a request that he wants to login to ASP.net web application via Google account. As I have never done something like that I have some concerns.

What bothers me is that he wants to add roles (administrator, user) to specific accounts and this puzzles me because I'm not sure how to connect Google account data with my database. I assume that I won't be able to get the password or username that I could store to my own database.

Where to start?


Solution

  • Use OpenID. This is implemented in ASP.NET in the DotNetOpenAuth library. It includes samples for Google logins, and it's very easy.

    The roles should work to. As you build up your user table, just add users to the appropriate roles.