From eb8020f29e8520ed8ac1e5590c1f99bdf6b875ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 1 Mar 2018 11:42:36 +0300 Subject: [PATCH] Added IDS to pipeline --- .../MicroservicesAuthServerModule.cs | 13 +++++++++++-- .../MicroserviceDemo.AuthServer/appsettings.json | 7 +++++++ .../IdentityServer/AbpIdentityServerDomainModule.cs | 2 -- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs index 21e54e30f6..7a9e6b2290 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs @@ -13,6 +13,7 @@ using Volo.Abp.Autofac; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.IdentityServer; using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; @@ -58,7 +59,15 @@ namespace MicroserviceDemo.AuthServer }); } - services.AddAuthorization(); + services.AddAuthentication() + .AddFacebook(options => + { + options.AppId = configuration["Authentication:Facebook:AppId"]; + options.AppSecret = configuration["Authentication:Facebook:AppSecret"]; + + options.Scope.Add("email"); + options.Scope.Add("public_profile"); + }); services.AddAssemblyOf(); } @@ -75,7 +84,7 @@ namespace MicroserviceDemo.AuthServer app.UseStaticFiles(); app.UseVirtualFiles(); - app.UseAuthentication(); + app.UseIdentityServer(); //This internally adds .UseAuthentication() (we should be carefully about that) app.UseMvc(routes => { diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json index a3a7ec3fb7..2d740d39f2 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json +++ b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json @@ -1,5 +1,12 @@ { "ConnectionStrings": { "Default": "Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true" + }, + "Authentication": { + "Facebook": { + "IsEnabled": "true", + "AppId": "911417875702990", + "AppSecret": "adea0bff222ae340d8fb0ce3e6275d6b" + } } } \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs index 3e49a826e6..fe033da5a9 100644 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs +++ b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs @@ -33,8 +33,6 @@ namespace Volo.Abp.IdentityServer identityServerBuilder .AddDeveloperSigningCredential() - //.AddInMemoryApiResources(IdentityServerConfig.GetApiResources()) - //.AddInMemoryClients(IdentityServerConfig.GetClients()) .AddAbpIdentityServer(); services.ExecutePreConfiguredActions(identityServerBuilder);