/// <summary>
        /// Method to decide which view service to use
        /// </summary>
        private void LoadViewService(IdentityServerServiceFactory factory)
        {
            var configService = new ApplicationSettingsConfigurationService();
            var viewType      = configService.GetSetting("ViewService", "Default");

            switch (viewType)
            {
            case "CustomStyle":
                //For the default view, but with our own stylesheet
                var viewOptions = new DefaultViewServiceOptions();
                viewOptions.Stylesheets.Add("/CustomView/Styles/DefaultViewStyles.css");
                viewOptions.CacheViews = false;
                factory.ConfigureDefaultViewService(viewOptions);     //Put the options with custom stylesheet or javascript into the factory
                break;

            case "FullCustomView":
                //For a complete custom view
                factory.ViewService = new Registration <IViewService>(typeof(CustomViewService));
                break;

            default:
                //Do nothing!
                break;
            }
        }
Beispiel #2
0
        public static void Register(ContainerBuilder builder)
        {
            var configService = new ApplicationSettingsConfigurationService();
            builder.Register(ctx => configService).As<IConfigurationService>();

            RegisterUserStore(configService, builder);
            RegisterExternalIdentityProviders(configService, builder);

            var identityServerUri = configService.GetSetting<string>("IdentityServerUri", null);
            var identityManagerUri = configService.GetSetting<string>("IdentityManagerUri", null);
            var identityAdminUri = configService.GetSetting<string>("IdentityAdminUri", null);

            builder.RegisterType<IdentityServerBootstrapper>();

            builder.RegisterType<IdentityAdminBootstrapper>()
                .WithParameter("identityServerUri", identityServerUri)
                .WithParameter("identityAdminUri", identityAdminUri);

            builder.RegisterType<IdentityManagerBootstrapper>()
                .WithParameter("identityServerUri", identityServerUri)
                .WithParameter("identityManagerUri", identityManagerUri);
        }
Beispiel #3
0
        public static void Register(ContainerBuilder builder)
        {
            var configService = new ApplicationSettingsConfigurationService();

            builder.Register(ctx => configService).As <IConfigurationService>();

            RegisterUserStore(configService, builder);
            RegisterExternalIdentityProviders(configService, builder);

            var identityServerUri  = configService.GetSetting <string>("IdentityServerUri", null);
            var identityManagerUri = configService.GetSetting <string>("IdentityManagerUri", null);
            var identityAdminUri   = configService.GetSetting <string>("IdentityAdminUri", null);

            builder.RegisterType <IdentityServerBootstrapper>();

            builder.RegisterType <IdentityAdminBootstrapper>()
            .WithParameter("identityServerUri", identityServerUri)
            .WithParameter("identityAdminUri", identityAdminUri);

            builder.RegisterType <IdentityManagerBootstrapper>()
            .WithParameter("identityServerUri", identityServerUri)
            .WithParameter("identityManagerUri", identityManagerUri);
        }
 /// <summary>
 /// Method to decide which view service to use
 /// </summary>
 private void LoadViewService(IdentityServerServiceFactory factory)
 {
     var configService = new ApplicationSettingsConfigurationService();
     var viewType = configService.GetSetting("ViewService", "Default");
     switch(viewType)
     {
         case "CustomStyle":
             //For the default view, but with our own stylesheet
             var viewOptions = new DefaultViewServiceOptions();
             viewOptions.Stylesheets.Add("/CustomView/Styles/DefaultViewStyles.css");
             viewOptions.CacheViews = false;
             factory.ConfigureDefaultViewService(viewOptions); //Put the options with custom stylesheet or javascript into the factory      
             break;
         case "FullCustomView":
             //For a complete custom view
             factory.ViewService = new Registration<IViewService>(typeof(CustomViewService));
             break;
         default:
             //Do nothing!
             break;
     }           
 }