• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Configuration.SPOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Kentor.AuthServices.Configuration.SPOptions的典型用法代码示例。如果您正苦于以下问题:C# SPOptions类的具体用法?C# SPOptions怎么用?C# SPOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SPOptions类属于Kentor.AuthServices.Configuration命名空间,在下文中一共展示了SPOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SPOptions_ModulePath_RejectsNull

        public void SPOptions_ModulePath_RejectsNull()
        {
            var subject = new SPOptions();
            Action a = () => subject.ModulePath = null;

            a.ShouldThrow<ArgumentNullException>().And.ParamName.Should().Be("value");
        }
开发者ID:Raschmann,项目名称:authservices,代码行数:7,代码来源:SPOptionsTests.cs


示例2: IdentityProvider

        internal IdentityProvider(IdentityProviderElement config, SPOptions spOptions)
        {
            singleSignOnServiceUrl = config.SignOnUrl;
            SingleLogoutServiceUrl = config.LogoutUrl;
            EntityId = new EntityId(config.EntityId);
            binding = config.Binding;
            AllowUnsolicitedAuthnResponse = config.AllowUnsolicitedAuthnResponse;
            metadataLocation = string.IsNullOrEmpty(config.MetadataLocation)
                ? null : config.MetadataLocation;
            WantAuthnRequestsSigned = config.WantAuthnRequestsSigned;
            DisableOutboundLogoutRequests = config.DisableOutboundLogoutRequests;

            var certificate = config.SigningCertificate.LoadCertificate();
            if (certificate != null)
            {
                signingKeys.AddConfiguredKey(
                    new X509RawDataKeyIdentifierClause(certificate));
            }

            foreach (var ars in config.ArtifactResolutionServices)
            {
                ArtifactResolutionServiceUrls[ars.Index] = ars.Location;
            }

            // If configured to load metadata, this will immediately do the load.
            this.spOptions = spOptions;
            LoadMetadata = config.LoadMetadata;

            // Validate if values are only from config. If metadata is loaded, validation
            // is done on metadata load.
            if (!LoadMetadata)
            {
                Validate();
            }
        }
开发者ID:woric,项目名称:authservices,代码行数:35,代码来源:IdentityProvider.cs


示例3: SPOptions_DecryptionCertificate_EmptyWhenOnlySigning

        public void SPOptions_DecryptionCertificate_EmptyWhenOnlySigning()
        {
            var subject = new SPOptions();
            subject.ServiceCertificates.Add(new ServiceCertificate { Use = CertificateUse.Signing, Certificate = SignedXmlHelper.TestCert2 });

            subject.DecryptionServiceCertificates.Count.Should().Be(0);
        }
开发者ID:woric,项目名称:authservices,代码行数:7,代码来源:SPOptionsTests.cs


示例4: SPOptions_Constructor_LoadsConfig

        public void SPOptions_Constructor_LoadsConfig()
        {
            var config = KentorAuthServicesSection.Current;
            config.AllowChange = true;
            config.AuthenticateRequestSigningBehavior = SigningBehavior.Always;
            config.Metadata.AllowChange = true;
            config.Metadata.WantAssertionsSigned = true;
            config.ValidateCertificates = true;

            ISPOptions subject = new SPOptions(KentorAuthServicesSection.Current);
            subject.ReturnUrl.Should().Be(config.ReturnUrl);
            subject.MetadataCacheDuration.Should().Be(config.Metadata.CacheDuration);
            subject.MetadataValidDuration.Should().Be(config.Metadata.ValidUntil);
            subject.WantAssertionsSigned.Should().Be(true);
            subject.ValidateCertificates.Should().Be(true);
            subject.DiscoveryServiceUrl.Should().Be(config.DiscoveryServiceUrl);
            subject.EntityId.Should().Be(config.EntityId);
            subject.ModulePath.Should().Be(config.ModulePath);
            subject.NameIdPolicy.AllowCreate.Should().Be(config.NameIdPolicyElement.AllowCreate);
            subject.NameIdPolicy.Format.Should().Be(config.NameIdPolicyElement.Format);
            subject.Organization.Should().Be(config.organization);
            subject.AuthenticateRequestSigningBehavior.Should().Be(config.AuthenticateRequestSigningBehavior);
            subject.RequestedAuthnContext.ClassRef.OriginalString.Should().Be("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport");
            subject.RequestedAuthnContext.Comparison.Should().Be(AuthnContextComparisonType.Minimum);
        }
开发者ID:victorayub,项目名称:authservices,代码行数:25,代码来源:SPOptionsTests.cs


示例5: CreateSPOptions

        internal static SPOptions CreateSPOptions()
        {
            var org = new Organization();

            org.Names.Add(new LocalizedName("Kentor.AuthServices", CultureInfo.InvariantCulture));
            org.DisplayNames.Add(new LocalizedName("Kentor AuthServices", CultureInfo.InvariantCulture));
            org.Urls.Add(new LocalizedUri(
                new Uri("http://github.com/KentorIT/authservices"),
                CultureInfo.InvariantCulture));

            var options = new SPOptions
            {
                EntityId = new EntityId("https://github.com/KentorIT/authservices"),
                MetadataCacheDuration = new TimeSpan(0, 0, 42),
                Organization = org,
                DiscoveryServiceUrl = new Uri("https://ds.example.com"),
                ReturnUrl = new Uri("https://localhost/returnUrl"),
            };

            options.SystemIdentityModelIdentityConfiguration.ClaimsAuthenticationManager
                = new ClaimsAuthenticationManagerStub();

            AddContacts(options);
            AddAttributeConsumingServices(options);

            return options;
        }
开发者ID:Raschmann,项目名称:authservices,代码行数:27,代码来源:StubFactory.cs


示例6: CreateSPOptions

        internal static SPOptions CreateSPOptions(Uri publicOrigin)
        {
            var org = new Organization();

            org.Names.Add(new LocalizedName("Kentor.AuthServices", CultureInfo.InvariantCulture));
            org.DisplayNames.Add(new LocalizedName("Kentor AuthServices", CultureInfo.InvariantCulture));
            org.Urls.Add(new LocalizedUri(
                new Uri("http://github.com/KentorIT/authservices"),
                CultureInfo.InvariantCulture));

            var options = new SPOptions
            {
                EntityId = new EntityId("https://github.com/KentorIT/authservices"),
                MetadataCacheDuration = new TimeSpan(0, 0, 42),
                MetadataValidDuration = TimeSpan.FromDays(24),
                WantAssertionsSigned = true,
                Organization = org,
                DiscoveryServiceUrl = new Uri("https://ds.example.com"),
                ReturnUrl = new Uri("https://localhost/returnUrl"),
                PublicOrigin = publicOrigin
            };

            options.SystemIdentityModelIdentityConfiguration.ClaimsAuthenticationManager
                = new ClaimsAuthenticationManagerStub();
            options.SystemIdentityModelIdentityConfiguration.AudienceRestriction.AudienceMode
                = AudienceUriMode.Never;

            AddContacts(options);
            AddAttributeConsumingServices(options);

            return options;
        }
开发者ID:johansvard,项目名称:authservices,代码行数:32,代码来源:StubFactory.cs


示例7: LoadOptionsFromConfiguration

        private static Options LoadOptionsFromConfiguration()
        {
            var spOptions = new SPOptions(KentorAuthServicesSection.Current);
            var options = new Options(spOptions);
            KentorAuthServicesSection.Current.IdentityProviders.RegisterIdentityProviders(options);
            KentorAuthServicesSection.Current.Federations.RegisterFederations(options);

            return options;
        }
开发者ID:arvinsuresh,项目名称:authservices,代码行数:9,代码来源:Options.cs


示例8: SPOptions_Saml2PSecurityTokenHandler_DefaultInstanceCreated

        public void SPOptions_Saml2PSecurityTokenHandler_DefaultInstanceCreated()
        {
            var subject = new SPOptions
            {
                EntityId = new EntityId(entityId)
            };

            subject.Saml2PSecurityTokenHandler.Should().NotBeNull();
            subject.Saml2PSecurityTokenHandler.Configuration.AudienceRestriction.AllowedAudienceUris
                .Should().Contain(new Uri(entityId));
        }
开发者ID:victorayub,项目名称:authservices,代码行数:11,代码来源:SPOptionsTests.cs


示例9: SPOptions_EntityId_SettingThrowsIfTokenHandlerCreated

        public void SPOptions_EntityId_SettingThrowsIfTokenHandlerCreated()
        {
            var subject = new SPOptions
            {
                EntityId = new EntityId(entityId)
            };

            subject.Saml2PSecurityTokenHandler.Should().NotBeNull();

            Action a = () => subject.EntityId = new EntityId(otherEntityId);

            a.ShouldThrow<InvalidOperationException>("Can't change entity id when a token handler has been instantiated.");
        }
开发者ID:victorayub,项目名称:authservices,代码行数:13,代码来源:SPOptionsTests.cs


示例10: KentorAuthServicesAuthenticationOptions

        public KentorAuthServicesAuthenticationOptions(bool loadConfiguration)
            : base(Constants.DefaultAuthenticationType)
        {
            AuthenticationMode = AuthenticationMode.Passive;
            Description.Caption = Constants.DefaultCaption;

            if (loadConfiguration)
            {
                SPOptions = new SPOptions(KentorAuthServicesSection.Current);
                KentorAuthServicesSection.Current.IdentityProviders.RegisterIdentityProviders(this);
                KentorAuthServicesSection.Current.Federations.RegisterFederations(this);
            }
        }
开发者ID:arvinsuresh,项目名称:authservices,代码行数:13,代码来源:KentorAuthServicesAuthenticationOptions.cs


示例11: SetUp

        public void SetUp()
        {
            spOptions = CreateSPOptions();
            options = new Options(spOptions);
            //Substitute.For<IOptions>();

            options.IdentityProviders.Add(Idp());
            //options.IdentityProviders.Returns(ReturnThis());


            userService = Substitute.For<IUserService>();
            underTest = new Saml2BearerGrantValidator(userService, options);
        }
开发者ID:dariusdamalakas,项目名称:IdentityServer3.Saml2BearerGrant,代码行数:13,代码来源:Saml2BearerGrantValidator.cs


示例12: CreateSPOptions

        private static SPOptions CreateSPOptions()
        {
            var spOptions = new SPOptions
            {
                EntityId = new EntityId(localMetaUri),
                ReturnUrl = returnUrl,
                WantAssertionsSigned = true
            };
            spOptions.ServiceCertificates.Add(new X509Certificate2(
                AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "/App_Data/AzureApp_private_sha256.pfx","nomad_is_1593*"));

            return spOptions;
        }
开发者ID:ivandriy,项目名称:devpoint,代码行数:13,代码来源:Startup.Auth.cs


示例13: Saml2PSecurityTokenHandler

        public Saml2PSecurityTokenHandler(SPOptions spOptions)
        {
            if (spOptions == null)
            {
                throw new ArgumentNullException(nameof(spOptions));
            }

            Configuration = new SecurityTokenHandlerConfiguration
            {
                IssuerNameRegistry = new ReturnRequestedIssuerNameRegistry(),
                AudienceRestriction = GetAudienceRestriction(spOptions),
                SaveBootstrapContext = spOptions.SystemIdentityModelIdentityConfiguration.SaveBootstrapContext
            };
        }
开发者ID:CDHDeveloper,项目名称:authservices,代码行数:14,代码来源:Saml2PSecurityTokenHandler.cs


示例14: AuthServicesUrls

        public AuthServicesUrls(HttpRequestData request, SPOptions spOptions)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            if (spOptions == null)
            {
                throw new ArgumentNullException(nameof(spOptions));
            }

            Init(request.ApplicationUrl, spOptions);
        }
开发者ID:CDHDeveloper,项目名称:authservices,代码行数:14,代码来源:AuthServicesUrls.cs


示例15: SPOptions_Constructor_LoadsConfig

        public void SPOptions_Constructor_LoadsConfig()
        {
            var config = KentorAuthServicesSection.Current;
            config.AllowChange(true);
            config.AuthenticateRequestSigningBehavior = SigningBehavior.Always;

            var subject = new SPOptions(KentorAuthServicesSection.Current);
            subject.ReturnUrl.Should().Be(config.ReturnUrl);
            subject.MetadataCacheDuration.Should().Be(config.MetadataCacheDuration);
            subject.DiscoveryServiceUrl.Should().Be(config.DiscoveryServiceUrl);
            subject.EntityId.Should().Be(config.EntityId);
            subject.ModulePath.Should().Be(config.ModulePath);
            subject.Organization.Should().Be(config.organization);
            subject.AuthenticateRequestSigningBehavior.Should().Be(config.AuthenticateRequestSigningBehavior);
        }
开发者ID:arvinsuresh,项目名称:authservices,代码行数:15,代码来源:SPOptionsTests.cs


示例16: AddContacts

        private static void AddContacts(SPOptions options)
        {
            var supportContact = new ContactPerson(ContactType.Support)
            {
                Company = "Kentor",
                GivenName = "Anders",
                Surname = "Abel",
            };

            supportContact.TelephoneNumbers.Add("+46 8 587 650 00");
            supportContact.TelephoneNumbers.Add("+46 708 96 50 63");
            supportContact.EmailAddresses.Add("[email protected]");
            supportContact.EmailAddresses.Add("[email protected]");

            options.Contacts.Add(supportContact);
            options.Contacts.Add(new ContactPerson(ContactType.Technical)); // Deliberately void of info.
        }
开发者ID:Raschmann,项目名称:authservices,代码行数:17,代码来源:StubFactory.cs


示例17: AddAttributeConsumingServices

        private static void AddAttributeConsumingServices(SPOptions options)
        {
            var a1 = new RequestedAttribute("urn:attributeName")
            {
                FriendlyName = "friendlyName",
                NameFormat = RequestedAttribute.AttributeNameFormatUri,
                AttributeValueXsiType = ClaimValueTypes.String,
                IsRequired = true
            };
            a1.Values.Add("value1");
            a1.Values.Add("value2");

            var a2 = new RequestedAttribute("someName");

            var acs = new AttributeConsumingService("attributeServiceName")
            {
                IsDefault = true
            };
            acs.RequestedAttributes.Add(a1);
            acs.RequestedAttributes.Add(a2);

            options.AttributeConsumingServices.Add(acs);
        }
开发者ID:Raschmann,项目名称:authservices,代码行数:23,代码来源:StubFactory.cs


示例18: SPOptions_MetadataCertificates_OverrideDoNotPublish

        public void SPOptions_MetadataCertificates_OverrideDoNotPublish()
        {
            var subject = new SPOptions();
            subject.ServiceCertificates.Add(new ServiceCertificate
            {
                MetadataPublishOverride = MetadataPublishOverrideType.DoNotPublish,
                Certificate = SignedXmlHelper.TestCert
            });

            var result = subject.MetadataCertificates;
            result.Count.Should().Be(0);
        }
开发者ID:victorayub,项目名称:authservices,代码行数:12,代码来源:SPOptionsTests.cs


示例19: SPOptions_MetadataCertificates_EmptyWhenNoneAdded

        public void SPOptions_MetadataCertificates_EmptyWhenNoneAdded()
        {
            var subject = new SPOptions();

            subject.MetadataCertificates.Count.Should().Be(0);
        }
开发者ID:victorayub,项目名称:authservices,代码行数:6,代码来源:SPOptionsTests.cs


示例20: SPOPtions_ModulePath_Default

 public void SPOPtions_ModulePath_Default()
 {
     var subject = new SPOptions();
     subject.ModulePath.Should().Be("/AuthServices");
 }
开发者ID:victorayub,项目名称:authservices,代码行数:5,代码来源:SPOptionsTests.cs



注:本文中的Kentor.AuthServices.Configuration.SPOptions类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebSso.HttpRequestData类代码示例发布时间:2022-05-26
下一篇:
C# Core.KeenClient类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap