protected override ServiceProviderSingleSignOnDescriptor BuildDescriptorInternal(RoleDescriptorConfiguration configuration) { var spConfiguration = configuration as SPSSODescriptorConfiguration; if (spConfiguration == null) { throw new InvalidCastException(string.Format("Expected type: {0} but was: {1}", typeof(SPSSODescriptorConfiguration).Name, configuration.GetType().Name)); } var descriptor = new ServiceProviderSingleSignOnDescriptor { WantAssertionsSigned = spConfiguration.WantAssertionsSigned, AuthenticationRequestsSigned = spConfiguration.AuthenticationRequestsSigned }; foreach (var cs in spConfiguration.AssertionConsumerServices) { var consumerService = new IndexedProtocolEndpoint(cs.Index, cs.Binding, cs.Location) { IsDefault = cs.IsDefault }; descriptor.AssertionConsumerServices.Add(cs.Index, consumerService); } return(descriptor); }
protected override IdentityProviderSingleSignOnDescriptor BuildDescriptorInternal(RoleDescriptorConfiguration configuration) { var idpConfiguration = configuration as IdPSSODescriptorConfiguration; if (idpConfiguration == null) { throw new InvalidCastException(string.Format("Expected type: {0} but was: {1}", typeof(IdPSSODescriptorConfiguration).Name, configuration.GetType().Name)); } var descriptor = new IdentityProviderSingleSignOnDescriptor { WantAuthenticationRequestsSigned = true }; idpConfiguration.SignOnServices.Aggregate(descriptor, (d, next) => { d.SingleSignOnServices.Add(new ProtocolEndpoint(next.Binding, next.Location)); return(d); }); return(descriptor); }
protected override ApplicationServiceDescriptor BuildDescriptorInternal(RoleDescriptorConfiguration configuration) { var idpConfiguration = configuration as IIdpSSOMetadataConfiguration; if (idpConfiguration == null) { throw new InvalidCastException(string.Format("Expected type: {0} but was: {1}", typeof(IdpSSOMetadataConfiguration).Name, configuration.GetType().Name)); } var appDescriptor = new ApplicationServiceDescriptor(); appDescriptor.ServiceDescription = "http://localhost:8080/idp/status"; //appDescriptor.Keys.Add(GetSigningKeyDescriptor()); //appDescriptor.PassiveRequestorEndpoints.Add(new EndpointReference("http://docs.oasis-open.org/wsfed/federation/200706")); //appDescriptor.TokenTypesOffered.Add(new Uri(TokenTypes.OasisWssSaml11TokenProfile11)); //appDescriptor.TokenTypesOffered.Add(new Uri(TokenTypes.OasisWssSaml2TokenProfile11)); //ClaimsRepository.GetSupportedClaimTypes().ToList().ForEach(claimType => appDescriptor.ClaimTypesOffered.Add(new DisplayClaim(claimType))); appDescriptor.ProtocolsSupported.Add(new Uri("http://docs.oasis-open.org/wsfed/federation/200706")); return(appDescriptor); //descriptor.ProtocolsSupported.Add(new Uri("http://docs.oasis-open.org/wsfed/federation/200706")); //foreach (var sso in idpConfiguration.SingleSignOnServices) //{ // var singleSignOnService = new ProtocolEndpoint(new Uri(sso.Binding), new Uri(sso.Location)); // descriptor.SingleSignOnServices.Add(singleSignOnService); //} //return descriptor; }