コード例 #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)
        {
            services.AddMvc();

            services.AddIdentityServer(options =>
            {
                // Set the lifetime of the authentication cookie to 5 seconds
                options.Authentication.CookieLifetime = TimeSpan.FromSeconds(5);
            })
            .AddDeveloperSigningCredential()
            .AddInMemoryClients(ClientConfiguration.Get())
            .AddInMemoryIdentityResources(IdentityResourceConfiguration.Get())
            .AddInMemoryApiResources(ApiResourceConfiguration.Get())
            .AddTestUsers(TestUserConfiguration.Get());
        }
コード例 #2
0
 public AccountController(TestUserStore user = null)
 {
     // Inject in the test users from our configuration
     this.users = users ?? new TestUserStore(TestUserConfiguration.Get());
 }