A GitHub OAuth 2 Client for ASP.NET MVC 4 via DotNetOpenAuth.
Add this to your project and add 1 line of code and it will hook directly into the Membership Provider in ASP.NET MVC 4!
Start with a default ASP.NET MVC 4 internet site project.
Install this package via Nuget!
After the package install finishes just fill in the "GitHub.ClientId" and "GitHub.ClientSecret" App Settings in the web.config.
The GitHub login service option should automatically appear on your /account/login page.
I don't know why you would need this, but if you want to manually add the project, you are welcome to do so. Currently there is no package for "just the dll". Here is what you would need to do:
- Pull down the project, compile it, and add a reference to it.
- Add your GitHub Client ID and Client Secret to your web.config
<add key="GitHub.ClientId" value= "YourClientId" />
<add key="GitHub.ClientSecret" value= "YourClientSecret" />
Add the following line to your AuthConfig.cs:
OAuthWebSecurity.RegisterClient(new JohnnyCode.GitHubOAuth2Client(ConfigurationManager.AppSettings["GitHub.ClientId"], ConfigurationManager.AppSettings["GitHub.ClientSecret"]), "GitHub", null);
Technically this route might be cleaner since you don't have a separate file for the package config. But until I create a core Nuget package for this library, I would stick with the existing Nuget package.