Beispiel #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddAuthentication();

            var builder = services.AddIdentityServer(options =>
            {
                options.IssuerUri = "https://idsvr4";
            });

            builder.AddInMemoryClients(Clients.Get());
            builder.AddInMemoryScopes(Scopes.Get());
            builder.AddInMemoryUsers(Users.Get());
            builder.SetSigningCredential(Cert.Load());

            builder.AddCustomGrantValidator<CustomGrantValidator>();
            builder.AddCustomGrantValidator<CustomGrantValidator2>();
        }
Beispiel #2
0
        public void ConfigureServices(IServiceCollection services)
        {
            var cert = new X509Certificate2(Path.Combine(_environment.ApplicationBasePath, "idsrv3test.pfx"), "idsrv3test");

            services.AddAuthentication();

            var builder = services.AddIdentityServer(options =>
            {
                options.SigningCertificate = cert;
                options.IssuerUri          = "https://idsrv4";
            });

            builder.AddInMemoryClients(Clients.Get());
            builder.AddInMemoryScopes(Scopes.Get());
            builder.AddInMemoryUsers(Users.Get());

            builder.AddCustomGrantValidator <CustomGrantValidator>();
            builder.AddCustomGrantValidator <CustomGrantValidator2>();
        }