I'm blond. I'm dumb. But I program.
So I want a damn simple way to authenticate with Facebook, Twitter or wherever.
I DON'T CARE IF IT'S OAUTH OR OPENID OR O-GO-SCREW-YOURSELF.
I just want to do
- Send me off to Facebook, Google or Twitter.
- Come back to my site and the site now has whatever user data they handed over.
That's It.
- No dabasase crap.
- No Session stuff.
- No over-generic-crazy one-solution-fits-every-provider-on-the-interwebs.
So install this bad boy :
Here's the main code that does what we want (excluding error checking, etc, for brevity).
public RedirectResult RedirectToAuthenticate(string providerKey)
{
var uri = _authenticationService.RedirectToAuthenticationProvider(providerKey);
return Redirect(uri.AbsoluteUri);
}
public ActionResult AuthenticateCallback(string providerKey)
{
var model = new AuthenticateCallbackViewModel();
model.AuthenticatedClient = _authenticationService.CheckCallback(providerKey, Request.Params);
return View(model);
}
- Read the sample code pages in the project's Wiki - take 1 minute to grok.
- Install nuget pacakge.
- Win.
Don't be scared to fork and then make some pull requests. I ❤️ pull requests!
Then this simple library can actually be really helpful to more than 1 person (le moi) on this rock called Earth.
No blonds or Unicorns were harmed in the coding of this library.