Пример #1
0
        private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options)
        {
            var wsFedOptions = new WsFederationPluginOptions(options);

            wsFedOptions.Factory.UseInMemoryRelyingParties(RelyingParties.Get());

            pluginApp.UseWsFederationPlugin(wsFedOptions);
        }
Пример #2
0
        private void ConfigureWsFederation(IAppBuilder pluginApp, IdentityServerOptions options)
        {
            var factory = new WsFederationServiceFactory(options.Factory);

            factory.Register(new Registration <IEnumerable <RelyingParty> >(RelyingParties.Get()));
            factory.RelyingPartyService = new Registration <IRelyingPartyService>(typeof(InMemoryRelyingPartyService));
            pluginApp.UseWsFederationPlugin(new WsFederationPluginOptions {
                IdentityServerOptions = options, Factory = factory
            });
        }
        protected virtual async ValueTask <IRelyingParty> GetRelyingPartyAsync(AppliesTo appliesTo, CancellationToken cancellationToken)
        {
            if (appliesTo == null)
            {
                return(null);
            }
            var id = appliesTo.EndpointReference.Uri;

            if (_cache.TryGetValue(id, out var party))
            {
                return(party);
            }
            var p = await RelyingParties.GetRelyingPartyAsync(appliesTo.EndpointReference.Uri);

            _cache.Add(id, p);
            return(p);
        }
        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);
        }
        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);
        }
Пример #6
0
        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));

            wsFedOptions.EnableMetadataEndpoint = true;

            pluginApp.UseWsFederationPlugin(wsFedOptions);
        }
        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);
        }