Problem with OAuth

May 4, 2013 at 8:50 AM
I've created a new VS2012 MVC4 project.
Added extmongomembership and mongo c# driver 1.8.1
Updated the web.config as described.
Regular user registration and login works with the mognodb.

Then I uncomment "OAuthWebSecurity.RegisterGoogleClient();" in the AuthConfig.cs file.
When logging in with a Google account, I get the error:
"The username supplied is invalid."
in the line:
OAuthWebSecurity.CreateOrUpdateAccount(provider, providerUserId, model.UserName);
of AccountController.cs

I've tried updating the connection string value of the UsersContext constructor and WebSecurity.InitializeDatabaseConnection from "DefaultConnection" to "mongodb" and got the error:
{"The ASP.NET Simple Membership database could not be initialized. For more information, please see"}

What am I doing wrong ? What is the proper way to allow using Google OAuth ?
May 4, 2013 at 8:08 PM

To use OAuthorization you need to do more steps. You need to create UserProfile and UserProfileService. And change Account finish login method. Please download source and take a look at 251 row of Account.cs. You can remove UserContext and dont use "WebSecurity.InitializeDatabaseConnection" as they are not used but this membership.

Please let me know if yo need more assistance.