Пример #1
0
 // This method gets called by the runtime. Use this method to add services to the container.
 // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
 public void ConfigureServices(IServiceCollection services)
 {
     //添加服务到DI
     services.AddIdentityServer()
     .AddDeveloperSigningCredential()
     .AddInMemoryApiResources(BasicConfig.GetApiResources())
     .AddInMemoryIdentityResources(BasicConfig.GetIdentityResources())
     .AddInMemoryClients(BasicConfig.GetClients())
     .AddTestUsers(BasicConfig.GetUsers());
 }
Пример #2
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddIdentityServer(options =>
     {
         options.Events.RaiseErrorEvents       = true;
         options.Events.RaiseInformationEvents = true;
         options.Events.RaiseFailureEvents     = true;
         options.Events.RaiseSuccessEvents     = true;
     })
     .AddDeveloperSigningCredential()
     .AddInMemoryApiResources(BasicConfig.GetApiResources())
     .AddInMemoryIdentityResources(BasicConfig.GetIdentityResources())
     .AddInMemoryClients(BasicConfig.GetClients())
     .AddTestUsers(BasicConfig.GetUsers());
     services.AddControllersWithViews();
 }