public static IAppBuilder UseWsFederationPlugin(this IAppBuilder app, WsFederationPluginOptions options)
        {
            app.UseCookieAuthentication(new CookieAuthenticationOptions
                {
                    AuthenticationType = WsFederationPluginOptions.WsFedCookieAuthenticationType,
                    AuthenticationMode = AuthenticationMode.Passive
                });

            if (options.RelyingPartyService == null)
            {
                throw new ArgumentNullException("RelyingPartyService");
            }

            options.Configuration.AddApiControllerAssembly(typeof(WsFederationController).Assembly);
            
            options.Configuration.AddTypeFactory(typeof(IRelyingPartyService), options.RelyingPartyService);
            
            options.Configuration.AddType(typeof(SignInValidator));
            options.Configuration.AddType(typeof(SignInResponseGenerator));
            options.Configuration.AddType(typeof(MetadataResponseGenerator));
            options.Configuration.AddType(typeof(CookieMiddlewareCookieService), typeof(ICookieService));

            options.Configuration.AddSignOutCallbackUrl("/wsfed/signout");

            return app;
        }
        private void ConfigurePlugins(IAppBuilder app, PluginConfiguration dependencies)
        {
            var options = new WsFederationPluginOptions(dependencies)
            {
                RelyingPartyService = () => new InMemoryRelyingPartyService(LocalTestRelyingParties.Get()),
            };

            app.UseWsFederationPlugin(options);
        }
        private void ConfigurePlugins(IAppBuilder app, PluginDependencies dependencies)
        {
            var options = new WsFederationPluginOptions(dependencies)
            {
                RelyingPartyService = () => new TestRelyingPartyService(),
            };

            app.UseWsFederationPlugin(options);
        }
 public WsFederationController(CoreSettings settings, IUserService users, SignInValidator validator, SignInResponseGenerator signInResponseGenerator, MetadataResponseGenerator metadataResponseGenerator, ITrackingCookieService cookies, InternalConfiguration internalConfig, WsFederationPluginOptions wsFedOptions)
 {
     _settings = settings;
     _internalConfig = internalConfig;
     _wsfedOptions = wsFedOptions;
     _validator = validator;
     _signInResponseGenerator = signInResponseGenerator;
     _metadataResponseGenerator = metadataResponseGenerator;
     _cookies = cookies;
 }