From 2d8c671e326bc37b94c85b2ad9a027f1486b64b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Thu, 24 Mar 2016 15:45:10 +0100 Subject: [PATCH] Add GitHub authentication in Mvc.Server --- samples/Mvc.Server/Startup.cs | 7 +++++++ samples/Mvc.Server/project.json | 1 + 2 files changed, 8 insertions(+) diff --git a/samples/Mvc.Server/Startup.cs b/samples/Mvc.Server/Startup.cs index 767d3912..e1403d2f 100644 --- a/samples/Mvc.Server/Startup.cs +++ b/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 => { diff --git a/samples/Mvc.Server/project.json b/samples/Mvc.Server/project.json index e6454284..b249a43d 100644 --- a/samples/Mvc.Server/project.json +++ b/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-*",