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; }
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; }
public static EntityDesriptorConfiguration BuildEntityDesriptorConfiguration() { var federationId = String.Format("{0}_{1}", "flowz", Guid.NewGuid()); var entityDescriptorConfiguration = new EntityDesriptorConfiguration { CacheDuration = TimeSpan.FromDays(100), EntityId = "Imperial.flowz.co.uk", Id = federationId, ValidUntil = new DateTimeOffset(DateTime.Now.AddDays(30)), Organisation = MetadataHelper.BuikdOrganisationConfiguration() }; return(entityDescriptorConfiguration); }
protected virtual EntityDescriptor BuildEntityDesciptor(EntityDesriptorConfiguration configuration, IEnumerable <RoleDescriptor> descriptors) { var entityDescriptor = new EntityDescriptor() { EntityId = new EntityId(configuration.EntityId), FederationId = configuration.Id }; descriptors.Aggregate(entityDescriptor, (ed, next) => { Assignment()(entityDescriptor, next); return(ed); }); return(entityDescriptor); }
public static EntityDesriptorConfiguration BuildEntityDesriptorConfiguration(EntityDescriptorSettings entityDescriptorSettings) { var federationId = String.Format("{0}_{1}", "eca", Guid.NewGuid()); var organisation = entityDescriptorSettings.IncludeOrganisationInfo ? MetadataHelper.BuidOrganisationConfiguration(entityDescriptorSettings.Organisation) : (OrganisationConfiguration)null; var entityDescriptorConfiguration = new EntityDesriptorConfiguration { CacheDuration = MetadataHelper.TimeSpanFromDatapartEntry(entityDescriptorSettings.CacheDuration), EntityId = entityDescriptorSettings.EntityId, Id = entityDescriptorSettings.FederationId, ValidUntil = entityDescriptorSettings.ValidUntil, Organisation = organisation, }; var spDescriptor = MetadataHelper.BuildSPSSODescriptorConfiguration(entityDescriptorSettings.RoleDescriptors.OfType <SPDescriptorSettings>().Single(), organisation); entityDescriptorConfiguration.RoleDescriptors.Add(spDescriptor); return(entityDescriptorConfiguration); }
public static EntityDesriptorConfiguration BuildEntityDesriptorConfiguration(bool includeOrganisation = false) { var federationId = String.Format("{0}_{1}", "IdpFederation", Guid.NewGuid()); var entityDescriptorConfiguration = new EntityDesriptorConfiguration { CacheDuration = TimeSpan.FromDays(100), EntityId = "https://www.eca-international.com", Id = federationId, ValidUntil = new DateTimeOffset(DateTime.Now.AddDays(30)), }; if (includeOrganisation) { entityDescriptorConfiguration.Organisation = MetadataHelper.BuildOrganisationConfiguration(); } return(entityDescriptorConfiguration); }
protected virtual EntityDescriptor BuildEntityDesciptor(EntityDesriptorConfiguration configuration, IEnumerable <RoleDescriptor> descriptors) { var entityDescriptor = new EntityDescriptor() { EntityId = new EntityId(configuration.EntityId), FederationId = configuration.Id }; Organization organisation; if (SSODescriptorBuilderHelper.TryBuildOrganisation(configuration.Organisation, out organisation)) { entityDescriptor.Organization = organisation; } SSODescriptorBuilderHelper.BuildContacts(entityDescriptor.Contacts, configuration.Organisation); descriptors.Aggregate(entityDescriptor, (ed, next) => { Assignment()(entityDescriptor, next); return(ed); }); return(entityDescriptor); }
public RequestConfiguration(string requestId, string version, EntityDesriptorConfiguration entityDesriptorConfiguration) { this.RequestId = requestId; this.Version = version; this._entityDesriptorConfiguration = entityDesriptorConfiguration; }