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); }
public static IAppBuilder UseWsFederationPlugin(this IAppBuilder app, WsFederationPluginOptions options) { if (options == null) { throw new ArgumentNullException("options"); } options.Validate(); options.IdentityServerOptions.ProtocolLogoutUrls.Add(options.LogoutUrl); app.Map(options.MapPath, wsfedApp => { wsfedApp.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = WsFederationPluginOptions.CookieName, AuthenticationMode = AuthenticationMode.Passive, CookieName = options.IdentityServerOptions.CookieOptions.Prefix + WsFederationPluginOptions.CookieName, }); wsfedApp.Use <AutofacContainerMiddleware>(AutofacConfig.Configure(options)); Microsoft.Owin.Infrastructure.SignatureConversions.AddConversions(app); wsfedApp.UseWebApi(WebApiConfig.Configure()); }); return(app); }
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options) { var wsFedOptions = new WsFederationPluginOptions(options); wsFedOptions.Factory.UseInMemoryRelyingParties(RelyingParties.Get()); pluginApp.UseWsFederationPlugin(wsFedOptions); }
public WsFederationController(SignInValidator validator, SignInResponseGenerator signInResponseGenerator, MetadataResponseGenerator metadataResponseGenerator, ITrackingCookieService cookies, WsFederationPluginOptions wsFedOptions) { _validator = validator; _signInResponseGenerator = signInResponseGenerator; _metadataResponseGenerator = metadataResponseGenerator; _cookies = cookies; _wsFedOptions = wsFedOptions; }
public WsFederationController(IdentityServerOptions options, IUserService users, SignInValidator validator, SignInResponseGenerator signInResponseGenerator, MetadataResponseGenerator metadataResponseGenerator, ITrackingCookieService cookies, WsFederationPluginOptions wsFedOptions) { _options = options; _validator = validator; _signInResponseGenerator = signInResponseGenerator; _metadataResponseGenerator = metadataResponseGenerator; _cookies = cookies; _wsFedOptions = wsFedOptions; }
private void ConfigurePlugins(IAppBuilder app, PluginConfiguration dependencies) { var options = new WsFederationPluginOptions(dependencies) { RelyingPartyService = () => new InMemoryRelyingPartyService(LocalTestRelyingParties.Get()), }; app.UseWsFederationPlugin(options); }
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options) { var wsFedOptions = new WsFederationPluginOptions(options); // data sources for in-memory services wsFedOptions.Factory.Register(new Registration <IEnumerable <RelyingParty> >(RelyingParties.Get())); wsFedOptions.Factory.RelyingPartyService = new Registration <IRelyingPartyService>(typeof(InMemoryRelyingPartyService)); pluginApp.UseWsFederationPlugin(wsFedOptions); }
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; }
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options) { var wsFedOptions = new WsFederationPluginOptions { IdentityServerOptions = options, Factory = new WsFederationServiceFactory { UserService = options.Factory.UserService, RelyingPartyService = Registration.RegisterFactory <IRelyingPartyService>(() => new InMemoryRelyingPartyService(RelyingParties.Get())), } }; pluginApp.UseWsFederationPlugin(wsFedOptions); }
private void ConfigureWsFederation(IAppBuilder pluginApp, IdentityServerOptions options) { var factory = new WsFederationServiceFactory(options.Factory) { RelyingPartyService = new Registration <IRelyingPartyService>(typeof(InMemoryRelyingPartyService)) }; factory.UseInMemoryRelyingParties(GetWsFedRelyingParties()); var wsFedOptions = new WsFederationPluginOptions { IdentityServerOptions = options, Factory = factory, EnableMetadataEndpoint = true }; pluginApp.UseWsFederationPlugin(wsFedOptions); }
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options) { var factory = new WsFederationServiceFactory { UserService = options.Factory.UserService, RelyingPartyService = Registration.RegisterType <IRelyingPartyService>(typeof(InMemoryRelyingPartyService)) }; // data sources for in-memory services factory.Register(Registration.RegisterSingleton <IEnumerable <RelyingParty> >(RelyingParties.Get())); var wsFedOptions = new WsFederationPluginOptions { IdentityServerOptions = options, Factory = factory }; pluginApp.UseWsFederationPlugin(wsFedOptions); }
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions coreOptions) { var wsfedOptions = new WsFederationPluginOptions { // todo - also signoutcleanup is broken right now LoginPageUrl = "http://localhost:3333/core/login", LogoutPageUrl = "http://localhost:3333/core/connect/logout", Factory = new WsFederationServiceFactory { UserService = coreOptions.Factory.UserService, CoreSettings = coreOptions.Factory.CoreSettings, RelyingPartyService = Registration.RegisterFactory <IRelyingPartyService>(() => new InMemoryRelyingPartyService(LocalTestRelyingParties.Get())), WsFederationSettings = Registration.RegisterFactory <WsFederationSettings>(() => new LocalTestWsFederationSettings()) }, }; pluginApp.UseWsFederationPlugin(wsfedOptions); }
public WsFederationController( SignInValidator validator, SignInResponseGenerator signInResponseGenerator, MetadataResponseGenerator metadataResponseGenerator, ITrackingCookieService cookies, WsFederationPluginOptions wsFedOptions, IRedirectUriValidator redirectUriValidator, SignOutValidator signOutValidator, Core.Services.OwinEnvironmentService environment) { _validator = validator; _signInResponseGenerator = signInResponseGenerator; _metadataResponseGenerator = metadataResponseGenerator; _cookies = cookies; _wsFedOptions = wsFedOptions; _redirectUriValidator = redirectUriValidator; _signOutValidator = signOutValidator; _events = environment.Environment.ResolveDependency <Core.Services.IEventService>() ?? new DefaultEventService(); }
private static void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options) { var efConfig = new EntityFrameworkServiceOptions { ConnectionString = "IdSvr3Config" }; // pre-populate the test DB from the in-memory config ConfigureRelyingParties(RelyingParties.Get(), efConfig); var factory = new WsFederationServiceFactory(options.Factory); factory.RegisterRelyingPartyService(efConfig); var wsFedOptions = new WsFederationPluginOptions(options) { Factory = factory }; pluginApp.UseWsFederationPlugin(wsFedOptions); }
/// <summary> /// Initializes a new instance of the DefaultRedirectUriValidator class /// </summary> /// <param name="wsFedOptions">Plugin options which contain the set of valid redirect URIs</param> public DefaultRedirectUriValidator(WsFederationPluginOptions wsFedOptions) { _wsFedOptions = wsFedOptions; }