Exemplo n.º 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());
 }
Exemplo n.º 2
0
 public AccountController(
     IIdentityServerInteractionService interaction,
     IAuthenticationSchemeProvider schemeProvider,
     IEventService events,
     IClientStore clientStore,
     TestUserStore users = null)
 {
     _users          = users ?? new TestUserStore(BasicConfig.GetUsers());
     _interaction    = interaction;
     _clientStore    = clientStore;
     _schemeProvider = schemeProvider;
     _events         = events;
 }
Exemplo n.º 3
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();
 }