当前位置: 首页>>代码示例>>C#>>正文


C# IdentityProvider.CreateAuthenticateRequest方法代码示例

本文整理汇总了C#中IdentityProvider.CreateAuthenticateRequest方法的典型用法代码示例。如果您正苦于以下问题:C# IdentityProvider.CreateAuthenticateRequest方法的具体用法?C# IdentityProvider.CreateAuthenticateRequest怎么用?C# IdentityProvider.CreateAuthenticateRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IdentityProvider的用法示例。


在下文中一共展示了IdentityProvider.CreateAuthenticateRequest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IdentityProvider_CreateAuthenticateRequest_Destination

        public void IdentityProvider_CreateAuthenticateRequest_Destination()
        {
            string idpUri = "http://idp.example.com/";
            
            var ip = new IdentityProvider(new Uri(idpUri));

            var r = ip.CreateAuthenticateRequest(null);

            r.ToXElement().Attribute("Destination").Should().NotBeNull()
                .And.Subject.Value.Should().Be(idpUri);
        }
开发者ID:dmarlow,项目名称:authservices,代码行数:11,代码来源:IdentityProviderTests.cs

示例2: IdentityProvider_CreateAuthenticateRequest_DestinationInXml

        public void IdentityProvider_CreateAuthenticateRequest_DestinationInXml()
        {
            string idpUri = "http://idp.example.com/";

            var subject = new IdentityProvider(
                new EntityId(idpUri),
                Options.FromConfiguration.SPOptions)
                {
                    SingleSignOnServiceUrl = new Uri(idpUri)
                };

            var r = subject.CreateAuthenticateRequest(null, StubFactory.CreateAuthServicesUrls());

            r.ToXElement().Attribute("Destination").Should().NotBeNull()
                .And.Subject.Value.Should().Be(idpUri);
        }
开发者ID:Bidou44,项目名称:authservices,代码行数:16,代码来源:IdentityProviderTests.cs

示例3: IdentityProvider_MetadataLoadedConfiguredFromCode

        public void IdentityProvider_MetadataLoadedConfiguredFromCode()
        {
            var spOptions = StubFactory.CreateSPOptions();

            spOptions.ServiceCertificates.Add(new ServiceCertificate()
            {
                Certificate = SignedXmlHelper.TestCert
            });

            var subject = new IdentityProvider(
                new EntityId("http://other.entityid.example.com"), spOptions)
            {
                MetadataLocation = "http://localhost:13428/idpMetadataOtherEntityId",
                AllowUnsolicitedAuthnResponse = true
            };

            subject.AllowUnsolicitedAuthnResponse.Should().BeTrue();
            subject.Binding.Should().Be(Saml2BindingType.HttpRedirect);
            subject.EntityId.Id.Should().Be("http://other.entityid.example.com");
            // If a metadatalocation is set, metadata loading is automatically enabled.
            subject.LoadMetadata.Should().BeTrue();
            subject.MetadataLocation.Should().Be("http://localhost:13428/idpMetadataOtherEntityId");
            subject.MetadataValidUntil.Should().BeCloseTo(
                DateTime.UtcNow.Add(MetadataRefreshScheduler.DefaultMetadataCacheDuration), precision: 100);
            subject.SingleSignOnServiceUrl.Should().Be("http://wrong.entityid.example.com/acs");
            subject.WantAuthnRequestsSigned.Should().Be(true, "WantAuthnRequestsSigned should have been loaded from metadata");

            Action a = () => subject.CreateAuthenticateRequest(StubFactory.CreateAuthServicesUrls());
            a.ShouldNotThrow();
        }
开发者ID:CDHDeveloper,项目名称:authservices,代码行数:30,代码来源:IdentityProviderTests.cs

示例4: IdentityProvider_CreateAuthenticateRequest_SigningBehaviorNever_OverridesIdpWantsRequestsSigned

        public void IdentityProvider_CreateAuthenticateRequest_SigningBehaviorNever_OverridesIdpWantsRequestsSigned()
        {
            var options = StubFactory.CreateOptions();
            var spOptions = options.SPOptions;
            spOptions.AuthenticateRequestSigningBehavior = SigningBehavior.Never;
            spOptions.ServiceCertificates.Add(new ServiceCertificate
            {
                Certificate = SignedXmlHelper.TestCert
            });

            var subject = new IdentityProvider(new EntityId("http://idp.example.com"), spOptions)
            {
                WantAuthnRequestsSigned = true
            };
            var urls = StubFactory.CreateAuthServicesUrls();

            var actual = subject.CreateAuthenticateRequest(urls).SigningCertificate;

            actual.Should().BeNull();
        }
开发者ID:CDHDeveloper,项目名称:authservices,代码行数:20,代码来源:IdentityProviderTests.cs

示例5: InitiateLoginToIdp

        private static CommandResult InitiateLoginToIdp(IOptions options, IDictionary<string, string> relayData, AuthServicesUrls urls, IdentityProvider idp, Uri returnUrl)
        {
            var authnRequest = idp.CreateAuthenticateRequest(urls);

            options.Notifications.AuthenticationRequestCreated(authnRequest, idp, relayData);

            var commandResult = idp.Bind(authnRequest);

            commandResult.RequestState = new StoredRequestState(
                idp.EntityId, returnUrl, authnRequest.Id, relayData);
            commandResult.SetCookieName = "Kentor." + authnRequest.RelayState;

            options.Notifications.SignInCommandResultCreated(commandResult, relayData);

            return commandResult;
        }
开发者ID:nate-impartner,项目名称:authservices,代码行数:16,代码来源:SignInCommand.cs

示例6: IdentityProvider_MetadataLoadedConfiguredFromCode

        public void IdentityProvider_MetadataLoadedConfiguredFromCode()
        {
            var subject = new IdentityProvider(
                new EntityId("http://other.entityid.example.com"),
                StubFactory.CreateSPOptions())
            {
                MetadataUrl = new Uri("http://localhost:13428/idpMetadataOtherEntityId"),
                AllowUnsolicitedAuthnResponse = true
            };

            subject.AllowUnsolicitedAuthnResponse.Should().BeTrue();
            subject.Binding.Should().Be(Saml2BindingType.HttpRedirect);
            subject.EntityId.Id.Should().Be("http://other.entityid.example.com");
            // If a metadatalocation is set, metadata loading is automatically enabled.
            subject.LoadMetadata.Should().BeTrue();
            subject.MetadataUrl.OriginalString.Should().Be("http://localhost:13428/idpMetadataOtherEntityId");
            subject.MetadataValidUntil.Should().BeCloseTo(
                DateTime.UtcNow.Add(MetadataRefreshScheduler.DefaultMetadataCacheDuration));
            subject.SingleSignOnServiceUrl.Should().Be("http://wrong.entityid.example.com/acs");

            Action a = () => subject.CreateAuthenticateRequest(null, StubFactory.CreateAuthServicesUrls());
            a.ShouldNotThrow();
        }
开发者ID:Bidou44,项目名称:authservices,代码行数:23,代码来源:IdentityProviderTests.cs


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