Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

OAuth in the Default ASP.NET 4.5 Templates

0 (0 Likes / 0 Dislikes)
  • Embed Video

  • Embed normal player Copy to Clipboard
  • Embed a smaller player Copy to Clipboard
  • Advanced Embedding Options
  • Embed Video With Transcription

  • Embed with transcription beside video Copy to Clipboard
  • Embed with transcription below video Copy to Clipboard
  • Embed transcript

  • Embed transcript in:
    Copy to Clipboard
  • Invite a user to Dotsub
[Microsoft ASP.netâ„¢] [www.ASP.net] [Visual Studeio 2012 & One ASP.NET] [Scott Hanselman, Principle Community Architect, Microsoft] Hi, this is Scott Hanselman. I wanted to take a moment to talk to you about Visual Studio 2012, and some of the new features in ASP.NET 4.5, in this video, specifically OAuth. We use OAuth to log into social networking sites, but we can also use it to log into sites that we create. OAuth support is included in ASP.NET in all of the default templates, so you can use OAuth in Web Forms, Web Pages, MVC, whatever works for you. Let me switch over to Visual Studio. I'll go to File New Project, and I can make an MVC or a Web Forms application. I'll pick Web Forms. Hit "Okay." And you'll notice that over in App_Start there is a file called AuthConfig. Inside that file includes a link to more information about OpenAuth as well as some commented out bits of code that show me that I can set up Twitter or Facebook or Microsoft or Google by uncommenting these and putting in my secrets. If I run the application by itself, it looks like the default template. I can register for this site using membership. I can log in. This side here that says "Use another service to log in" is not configured. I've done this work ahead of time, so I'm just going to grab this AuthConfig file and drop it into App_Start. And I'm going to change the namespace to match my application. You've got my secrets for Twitter and Facebook there. I'll run the application, hit "Log in," and then these buttons have lit up. Now this is set up to use membership. This means that this is in addition to the ASP.NET membership features that you already know how to use. You can add this to an existing membership database with minimal changes. Here I'm going to go and log in with Twitter. I'm redirected to Twitter. Notice it says "MembershipTest_DamianEdwards." That's the name of the application that we set up ahead of time. Hit "Sign in." Now we've redirect back from Twitter. And now it's saying "Register with your Twitter account." Log in. Now I'm actually logged in to ASP.NET membership at this point, but I'm logged in using an external account. I don't have a local password on this site. I could set up a local password. You'll notice that we're taking care of all the different complexities that one would need to deal with in a situation like this. Someone might want to have a local account and then add an external account later. They might want to have multiple registered external logins. For example, here we've got Twitter. I could go and add in Facebook later or log in with my Google account. Now I'm logged in as shanselman with both Google and Twitter. All this OAuth support comes out of the box. You don't need a special template to use it. You just say "File New Project" and it works. We include Google, Microsoft, Twitter, and Facebook, and you could certainly add your own if you'd like. This all uses the open source library DotNetOpenAuth. This is just another example of where we've added open source to ASP.NET. I think it's a really great feature, and I'm pretty excited about it, and I hope you enjoy using it. [Microsoft ASP.netâ„¢] [www.ASP.net]

Video Details

Duration: 3 minutes and 44 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 6
Posted by: neudesicasp on Oct 3, 2013

OAuth in the Default ASP.NET 4.5 Templates

Caption and Translate

    Sign In/Register for Dotsub to translate this video.