Ejemplo n.º 1
0
        public void Configuration(IAppBuilder app)
        {
            var inMemoryManager = new InMemoryManager();
            var factory         = new IdentityServerServiceFactory()
                                  .UseInMemoryUsers(inMemoryManager.GetUsers())
                                  .UseInMemoryScopes(inMemoryManager.GetScopes())
                                  .UseInMemoryClients(inMemoryManager.GetClients());
            var certificate = Convert.FromBase64String(ConfigurationManager.AppSettings["SigningCertificate"]);
            var options     = new IdentityServerOptions()
            {
                SigningCertificate = new X509Certificate2(certificate, ConfigurationManager.AppSettings["SigningCertificatePassword"]),
                RequireSsl         = false, //should be true in PROD
                Factory            = factory
            };

            app.UseIdentityServer(options);
        }
Ejemplo n.º 2
0
        public void Configuration(IAppBuilder app)
        {
            var certificate     = Convert.FromBase64String(ConfigurationManager.AppSettings["SigningCertificate"]);
            var inMemoryManager = new InMemoryManager();
            var factory         = new IdentityServerServiceFactory()
                                  .UseInMemoryUsers(inMemoryManager.GetUsers())
                                  .UseInMemoryScopes(inMemoryManager.GetScopes())
                                  .UseInMemoryClients(inMemoryManager.GetClients());

            var options = new IdentityServerOptions()
            {
                SigningCertificate = new X509Certificate2(certificate, ConfigurationManager.AppSettings["SigningCertificatePassword"]),
                RequireSsl         = false,
                Factory            = factory
            };

            app.UseIdentityServer(options);
            // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888
        }