Beispiel #1
0
        private void ConfigSecurity(IAppBuilder app)
        {
            var factory = new IdentityServerServiceFactory();

            factory.UseInMemoryClients(SecurityConfig.LoadClients())
            .UseInMemoryScopes(SecurityConfig.LoadScopes());

            factory.Register(new Registration <UserManager <IdentityUser, string> >(resolver => new BulbaUserManager(new UserStore <IdentityUser>(new UserContext()))));
            factory.Register(new Registration <AspNetIdentityUserService <IdentityUser, string> >());
            factory.UserService = new Registration <IUserService, AspNetIdentityUserService <IdentityUser, string> >();

            var options = new IdentityServerOptions
            {
                Factory            = factory,
                IssuerUri          = "http://localhost:44382",
                RequireSsl         = false,
                SiteName           = "BulbaCourses SSO",
                SigningCertificate = new X509Certificate2(Resources.bulbacourses, "123")
            };

            app.UseIdentityServer(options);
        }