Browse Source

Add GitHub authentication in Mvc.Server

pull/80/head
Kévin Chalet 10 years ago
parent
commit
2d8c671e32
  1. 7
      samples/Mvc.Server/Startup.cs
  2. 1
      samples/Mvc.Server/project.json

7
samples/Mvc.Server/Startup.cs

@ -1,4 +1,5 @@
using System.Linq;
using AspNet.Security.OAuth.GitHub;
using CryptoHelper;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -96,6 +97,12 @@ namespace Mvc.Server {
ConsumerSecret = "Il2eFzGIrYhz6BWjYhVXBPQSfZuS4xoHpSSyD9PI"
});
app.UseGitHubAuthentication(new GitHubAuthenticationOptions {
ClientId = "49e302895d8b09ea5656",
ClientSecret = "98f1bf028608901e9df91d64ee61536fe562064b",
Scope = { "user:email" }
});
// Note: OpenIddict must be added after
// ASP.NET Identity and the external providers.
app.UseOpenIddict(options => {

1
samples/Mvc.Server/project.json

@ -1,5 +1,6 @@
{
"dependencies": {
"AspNet.Security.OAuth.GitHub": "1.0.0-*",
"AspNet.Security.OAuth.Introspection": "1.0.0-*",
"AspNet.Security.OAuth.Validation": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.Google": "1.0.0-*",

Loading…
Cancel
Save