Your official information source from the .NET Web Development and Tools group at Microsoft.
[Update]
Adding relevant links at the bottom of the post
One of the coolest features in Visual Studio 2012 is the ability to login using your Microsoft, Facebook, Twitter or Google account. The project templates showcase a social way of logging in along with the usual way of logging in by creating a local account
This post highlights how you can turn on support for logging through these services in the project templates. Head over the following video to get a quick glance on this feature http://www.asp.net/vnext/overview/videos/oauth-in-the-default-aspnet-45-templates
Steps to get keys for Facebook
Steps to get keys for Twitter
OpenAuth.AuthenticationClients.AddTwitter(
consumerKey: "your Twitter consumer key",
consumerSecret: "your Twitter consumer secret");
OpenAuth.AuthenticationClients.AddFacebook(
appId: "your Facebook app id",
appSecret: "your Facebook app secret");
//OAuthWebSecurity.RegisterTwitterClient(
// consumerKey: "",
// consumerSecret: "");
//OAuthWebSecurity.RegisterFacebookClient(
// appId: "",
// appSecret: "");
OpenAuth.AuthenticationClients.AddGoogle();
OAuthWebSecurity.RegisterGoogleClient();
http://blogs.msdn.com/b/webdev/archive/2012/08/22/extra-information-from-oauth-openid-provider.aspx
http://blogs.msdn.com/b/pranav_rastogi/archive/2012/08/23/plugging-custom-oauth-openid-providers.aspx
http://blogs.msdn.com/b/webdev/archive/2012/08/24/customizing-the-login-ui-when-using-oauth-openid.aspx
http://blogs.msdn.com/b/webdev/archive/2012/09/12/integrate-openauth-openid-with-your-existing-asp-net-application-using-universal-providers.aspx
http://blogs.msdn.com/b/webdev/archive/2012/09/19/configuring-your-asp-net-application-for-microsoft-oauth-account.aspx
http://www.asp.net/mvc/overview/getting-started/using-oauth-providers-with-mvc
Happy Logging in a social way!!!
Hi there great news.
Can you please tell me can I use same functionality in ASP.NET Web API ?
@Radenko yes you can. We will post a sample in a few weeks on how to do it as well
Hi,
This feature is really cool. Is it possible to change the default provider endpoint with another?
How do you get your secrets/keys to use a Microsoft Account?
@jimspo goto https://manage.dev.live.com
@plamikcho can you please explain more. You can use any provider and the endpoint
This is great. Is there a way to request extra data such as email address? Also is there any additional documentation?
Thanks.
@Stephen you have access to the email address when you authenticate with the provider. We will have more documentation coming soon on asp.net site
This is indeed one of the coolest features! Very impressed. Thank you!
Nice, but how does this tie in and work seamlessly with WIF and claims-based identity architecture? What if ADFS and WS-Trust/Federation is desired to bring AD users aboard as well?
@icelava this is something we are working on for the future
Like Stephen asked, I know that the e-mail address comes back when you authenticate, but is there a way to request firstName and lastName or other information when using these providers? I know that Google can return this data, but I am not sure how to request this extra information using this API.
what about membership and role provider?
@Andrea the current implementation of openAuth integrated with the existing roles/membership/profile universal providers
This is a great feature, but when i try the and access the manage page(by clicking on the username) I get this error: Method not found: 'Boolean WebMatrix.WebData.ExtendedMembershipProvider.HasLocalAccount(Int32)'.
What am i doing wrong?
Cheers!
@iJunkie can you please post the full stack trace? Did you start with a ASP.NET MVC4 Internet application?
Also it would be a good idea if you can post your problem on stack overflow forums and tag it with "openauth" There are a lot of people watching and answering questions on this forum and it will help resolve your issue faster