Пример #1
0
        public AuthnRequestConfiguration(string requestId, EntityDesriptorConfiguration entityDesriptorConfiguration, FederationPartyAuthnRequestConfiguration federationPartyAuthnRequestConfiguration)
            : base(requestId, federationPartyAuthnRequestConfiguration.Version, entityDesriptorConfiguration)
        {
            if (entityDesriptorConfiguration == null)
            {
                throw new ArgumentNullException("entityDesriptorConfiguration");
            }

            if (federationPartyAuthnRequestConfiguration == null)
            {
                throw new ArgumentNullException("federationPartyAuthnRequestConfiguration");
            }
            this._federationPartyAuthnRequestConfiguration = federationPartyAuthnRequestConfiguration;
            this.AudienceRestriction = new List <string> {
                entityDesriptorConfiguration.EntityId
            };
            this.ForceAuthn                         = federationPartyAuthnRequestConfiguration.ForceAuthn;
            this.IsPassive                          = federationPartyAuthnRequestConfiguration.IsPassive;
            this.EncryptNameId                      = federationPartyAuthnRequestConfiguration.DefaultNameId.EncryptNameId;
            this.AllowCreateNameIdPolicy            = federationPartyAuthnRequestConfiguration.DefaultNameId.AllowCreate;
            this.SupportedNameIdentifierFormats     = new List <Uri>();
            this.DefaultNameIdFormat                = federationPartyAuthnRequestConfiguration.DefaultNameId.NameIdFormat;
            this.RequestedAuthnContextConfiguration = federationPartyAuthnRequestConfiguration.RequestedAuthnContextConfiguration;
            this.ScopingConfiguration               = federationPartyAuthnRequestConfiguration.ScopingConfiguration;
        }
Пример #2
0
        public AuthnRequestConfiguration(EntityDesriptorConfiguration entityDesriptorConfiguration, ScopingConfiguration scopingConfiguration, FederationPartyAuthnRequestConfiguration federationPartyAuthnRequestConfiguration)
        {
            if (entityDesriptorConfiguration == null)
            {
                throw new ArgumentNullException("entityDesriptorConfiguration");
            }

            if (federationPartyAuthnRequestConfiguration == null)
            {
                throw new ArgumentNullException("federationPartyAuthnRequestConfiguration");
            }
            if (federationPartyAuthnRequestConfiguration.RequestedAuthnContextConfiguration == null)
            {
                throw new ArgumentNullException("requestedAuthnContextConfiguration");
            }

            this._entityDesriptorConfiguration = entityDesriptorConfiguration;
            this.EntityId  = entityDesriptorConfiguration.EntityId;
            this.RequestId = String.Format("{0}_{1}", entityDesriptorConfiguration.Id, Guid.NewGuid().ToString());
            this.AssertionConsumerServiceIndex = (ushort)entityDesriptorConfiguration.SPSSODescriptors.SelectMany(x => x.AssertionConsumerServices)
                                                 .Single(x => x.IsDefault.GetValueOrDefault()).Index;
            this.AudienceRestriction = new List <string> {
                entityDesriptorConfiguration.EntityId
            };
            this.ForceAuthn                         = federationPartyAuthnRequestConfiguration.ForceAuthn;
            this.IsPassive                          = federationPartyAuthnRequestConfiguration.IsPassive;
            this.Version                            = federationPartyAuthnRequestConfiguration.Version;
            this.EncryptNameId                      = federationPartyAuthnRequestConfiguration.DefaultNameId.EncryptNameId;
            this.AllowCreateNameIdPolicy            = federationPartyAuthnRequestConfiguration.DefaultNameId.AllowCreate;
            this.SupportedNameIdentifierFormats     = new List <Uri>();
            this.DefaultNameIdFormat                = federationPartyAuthnRequestConfiguration.DefaultNameId.NameIdFormat;
            this.RequestedAuthnContextConfiguration = federationPartyAuthnRequestConfiguration.RequestedAuthnContextConfiguration;
            this.ScopingConfiguration               = scopingConfiguration;
        }