From e8f725913b3f504ed4ee14cf274b7f9dda1fe1ff Mon Sep 17 00:00:00 2001 From: Valeriy Krashenko Date: Tue, 19 Dec 2017 18:47:12 +0200 Subject: [PATCH] add github and stackexchange providers #34 --- VirtoCommerce.Storefront/Startup.cs | 16 ++++++++++++++++ .../VirtoCommerce.Storefront.csproj | 2 ++ 2 files changed, 18 insertions(+) diff --git a/VirtoCommerce.Storefront/Startup.cs b/VirtoCommerce.Storefront/Startup.cs index 1e02a1bd4..cd19f80dd 100644 --- a/VirtoCommerce.Storefront/Startup.cs +++ b/VirtoCommerce.Storefront/Startup.cs @@ -159,6 +159,22 @@ public void ConfigureServices(IServiceCollection services) googleSection.Bind(googleOptions); }); } + var githubSection = Configuration.GetSection("Authentication:Github"); + if (githubSection.GetChildren().Any()) + { + auth.AddGitHub(GitHubAuthenticationOptions => + { + githubSection.Bind(GitHubAuthenticationOptions); + }); + } + var stackexchangeSection = Configuration.GetSection("Authentication:Stackexchange"); + if (stackexchangeSection.GetChildren().Any()) + { + auth.AddStackExchange(StackExchangeAuthenticationOptions => + { + stackexchangeSection.Bind(StackExchangeAuthenticationOptions); + }); + } services.AddIdentity(options => { options.Password.RequiredLength = 8; diff --git a/VirtoCommerce.Storefront/VirtoCommerce.Storefront.csproj b/VirtoCommerce.Storefront/VirtoCommerce.Storefront.csproj index eab62f98e..9a12c07c8 100644 --- a/VirtoCommerce.Storefront/VirtoCommerce.Storefront.csproj +++ b/VirtoCommerce.Storefront/VirtoCommerce.Storefront.csproj @@ -25,6 +25,8 @@ + +