Browse Source

Added IDS to pipeline

pull/217/head
Halil İbrahim Kalkan 9 years ago
parent
commit
eb8020f29e
  1. 13
      src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs
  2. 7
      src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json
  3. 2
      src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs

13
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<MicroservicesAuthServerModule>();
}
@ -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 =>
{

7
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"
}
}
}

2
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);

Loading…
Cancel
Save