// 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()); }
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; }
// 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(); }