Problem with OAuth

May 4, 2013 at 7: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 http://go.microsoft.com/fwlink/?LinkId=256588"}

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

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.

Thanks,
Dmitriy