Beispiel #1
0
        public void BuildAuthnRequest_test_scoping_default_overwritten_2_requesters()
        {
            //ARRANGE
            var requestUri = new Uri("http://localhost:59611/");
            var federationPartyContextBuilder = new FederationPartyContextBuilderMock();
            var scopingConfiguration          = new ScopingConfiguration("http://localhost:59611/", "http://localhost:59612/")
            {
                PoxyCount = 10
            };
            var federationContext = federationPartyContextBuilder.BuildContext("local", scopingConfiguration);
            var supportedNameIdentifierFormats = new List <Uri> {
                new Uri(NameIdentifierFormats.Transient)
            };
            var authnRequestContext  = new AuthnRequestContext(requestUri, new Uri("http://localhost"), federationContext, supportedNameIdentifierFormats);
            var requestConfiguration = federationContext.GetAuthnRequestConfigurationFromContext(Guid.NewGuid().ToString());

            RequestHelper.GetAuthnRequestBuilders = AuthnRequestBuildersFactoryMock.GetAuthnRequestBuildersFactory();

            //ACT
            var authnRequest = RequestHelper.BuildRequest(authnRequestContext) as AuthnRequest;

            //ASSERT
            Assert.NotNull(authnRequest);
            Assert.IsNotNull(authnRequest.Scoping);
            Assert.AreEqual("10", authnRequest.Scoping.ProxyCount);
            Assert.AreEqual(2, authnRequest.Scoping.RequesterId.Length);
            Assert.AreEqual("http://localhost:59611/", authnRequest.Scoping.RequesterId[0]);
            Assert.AreEqual("http://localhost:59612/", authnRequest.Scoping.RequesterId[1]);
        }
Beispiel #2
0
 public FederationPartyAuthnRequestConfiguration(RequestedAuthnContextConfiguration requestedAuthnContextConfiguration, DefaultNameId defaultNameId, ScopingConfiguration scopingConfiguration)
 {
     this.RequestedAuthnContextConfiguration = requestedAuthnContextConfiguration;
     this.DefaultNameId        = defaultNameId;
     this.ScopingConfiguration = scopingConfiguration;
     this.Version                = "2.0";
     this.IsPassive              = false;
     this.ForceAuthn             = false;
     this.AssertionIndexEndpoint = 0;
 }
Beispiel #3
0
        public FederationPartyConfiguration BuildContext(string federationPartyId, string defaultNameIdFormat, ScopingConfiguration scopingConfiguration, RequestedAuthnContextConfiguration requestedAuthnContextConfiguration)
        {
            var nameIdconfiguration = new DefaultNameId(new Uri(defaultNameIdFormat));
            var federationPartyAuthnRequestConfiguration = new FederationPartyAuthnRequestConfiguration(requestedAuthnContextConfiguration, nameIdconfiguration, scopingConfiguration);

            return(new FederationPartyConfiguration("local", "https://dg-mfb/idp/shibboleth")
            {
                MetadataContext = this._inlineMetadataContextBuilder.BuildContext(new MetadataGenerateRequest(MetadataType.SP, "local")),
                FederationPartyAuthnRequestConfiguration = federationPartyAuthnRequestConfiguration
            });
        }
Beispiel #4
0
        public FederationPartyConfiguration BuildContext(string federationPartyId, string defaultNameIdFormat, ScopingConfiguration scopingConfiguration)
        {
            var requestedAuthnContextConfiguration = this.BuildRequestedAuthnContextConfiguration();

            return(this.BuildContext(federationPartyId, defaultNameIdFormat, scopingConfiguration, requestedAuthnContextConfiguration));
        }
Beispiel #5
0
 public FederationPartyConfiguration BuildContext(string federationPartyId, ScopingConfiguration scopingConfiguration)
 {
     return(this.BuildContext(federationPartyId, NameIdentifierFormats.Unspecified, scopingConfiguration));
 }