Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

ziyasal-archive/SocialAuth4Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SocialAuth4Net

SocialAuth4Net is an OAuth wrapper library for popular social platforms. Following platforms are included;

  • Facebook
  • LinkedIn
  • Twitter

NuGet Package

Basic Usage

##Facebook MVC Sample

Setup config

<add key="Fb-ApiKey" value="your facebook api key"/>
<add key="Fb-ApiSecret" value="your fb api secret"/>
<add key ="Fb-RedirectUri" value="your redirect url"/>

Info : Your redirect url Where do you want to process authentication operation..

Setup Link
Controller Index Action

public ActionResult Index()
{
    ViewBag.UrlParameters = OAuthManager.GetUrlParametersFor<FacebookAuthenticator>(string.Empty);
    return View();
 }

Index View Markup

<a href="https://www.facebook.com/dialog/oauth?@ViewBag.UrlParameters">
   <img src="@Url.Content("~/Content/themes/base/images/fblogin.png")"/>
</a>

After Facebook Redirected
Controller Authenticate Action

public ActionResult Authenticate()
 {
    FacebookProfile facebookProfile = OAuthManager.GetAuthenticatedProfileForFacebook(Request.QueryString);
    if (!string.IsNullOrEmpty(facebookProfile.id))
    {
      return Content(facebookProfile.id + "<br/>" + facebookProfile.first_name + "<br/>" + facebookProfile.last_name);
    }

    return Content("");
}

About

SocialAuth4Net is an OAuth wrapper library for popular social platforms.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages