public void Saml2pSecurityTokenHandler_SaveBootstrapContextLoadFromConfig()
        {
            var spOptions = Options.FromConfiguration.SPOptions;

            var subject = new Saml2PSecurityTokenHandler(spOptions);

            subject.Configuration.SaveBootstrapContext.Should().BeTrue();
        }
        public void Saml2PSecurityTokenHandler_SaveBootstrapContextDefaultFalse()
        {
            var spOptions = StubFactory.CreateSPOptions();

            var subject = new Saml2PSecurityTokenHandler(spOptions);

            subject.Configuration.SaveBootstrapContext.Should().BeFalse();
        }
        public void Saml2PSecurityTokenHandler_SaveBoostrapContextFromConfig()
        {
            var spOptions = StubFactory.CreateSPOptions();
            spOptions.SystemIdentityModelIdentityConfiguration.SaveBootstrapContext = true;

            var subject = new Saml2PSecurityTokenHandler(spOptions);

            subject.Configuration.SaveBootstrapContext.Should().BeTrue();
        }
        public void Saml2PSecurityTokenHandler_ShouldHaveDefaultAudienceRestrictionOfEntityId()
        {
            var spOptions = StubFactory.CreateSPOptions();
            spOptions.SystemIdentityModelIdentityConfiguration.AudienceRestriction.AudienceMode
                 = AudienceUriMode.Always;

            spOptions.EntityId.Id = "http://testuri/";

            var subject = new Saml2PSecurityTokenHandler(spOptions);

            subject.Configuration.AudienceRestriction.AllowedAudienceUris.First().AbsoluteUri.Should().Be("http://testuri/");
        }
        public void Saml2PSecurityTokenHandler_ShouldReadAudienceUrisFromIdentityModelConfig()
        {
            var spOptions = StubFactory.CreateSPOptions();
            spOptions.SystemIdentityModelIdentityConfiguration.AudienceRestriction = 
                new AudienceRestriction
                    {
                        AllowedAudienceUris = { new Uri("http://firsturi/"), new Uri("http://seconduri/") }
                    };

            var subject = new Saml2PSecurityTokenHandler(spOptions);

            subject.Configuration.AudienceRestriction.AllowedAudienceUris.Should().Contain(new Uri("http://firsturi/"));
            subject.Configuration.AudienceRestriction.AllowedAudienceUris.Should().Contain(new Uri("http://seconduri/"));
        }
예제 #6
0
        public void SPOptions_Saml2PSecurityTokenHandler_Setter()
        {
            var subject = StubFactory.CreateSPOptions();

            var handler = new Saml2PSecurityTokenHandler(subject);

            subject.Saml2PSecurityTokenHandler = handler;

            subject.Saml2PSecurityTokenHandler.Should().BeSameAs(handler);
        }