Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

IdentityServer4 ConfigurationStore(ClientStore,ResourceStore,CorsPolicyService) for Abp(https://github.com/aspnetboilerplate/aspnetboilerplate)

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE-IdentityServer4-EntityFramework
Notifications You must be signed in to change notification settings

Mjollnirs/Abp.ZeroCore.IdentityServer4.Configuration

Abp.ZeroCore.IdentityServer4.Configuration

Build status NuGet version

    [DependsOn(typeof(AbpZeroCoreIdentityServer4ConfigurationModule))]
    public class OpenIdCoreModule : AbpModule {
        
    }
    [DependsOn(
        typeof(OpenIdCoreModule),
        typeof(AbpZeroCoreEntityFrameworkCoreModule),
        typeof(AbpZeroCoreIdentityServer4ConfigurationModule))]
    public class OpenIdEntityFrameworkModule : AbpModule {
    }
using Abp.IdentityServer4;
using Abp.IdentityServer4.Entities;
using Abp.IdentityServer4.Extensions;

public class OpenIdDbContext : AbpZeroDbContext<Tenant, Role, User, OpenIdDbContext>, IAbpConfigurationDbContext {
        public DbSet<Client> Clients { get; set; }

        public DbSet<IdentityResource> IdentityResources { get; set; }

        public DbSet<ApiResource> ApiResources { get; set; }
        
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ConfigureConfigurationContext();

            base.OnModelCreating(modelBuilder);
        }
}

InitialHostDbBuilder.cs

new DefaultIdentityServerConfigCreator(_context).Create();

Startup.cs

        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            IdentityRegistrar.Register(services);
            AuthConfigurer.Configure(services, _appConfiguration);
            services.AddIdentityServer()
                .AddSigningCredential(new X509Certificate2(_appConfiguration["Authentication:IdentityServer:File"],
                    _appConfiguration["Authentication:IdentityServer:Password"]))
                .AddAbpPersistedGrants<IAbpPersistedGrantDbContext>()
                .AddConfigurationStore<IAbpConfigurationDbContext>()
                .AddAbpIdentityServer<User>();
        }
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.UseAuthentication();

            app.UseJwtTokenMiddleware();

            app.UseIdentityServer();
        }

About

IdentityServer4 ConfigurationStore(ClientStore,ResourceStore,CorsPolicyService) for Abp(https://github.com/aspnetboilerplate/aspnetboilerplate)

Topics

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE-IdentityServer4-EntityFramework

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages