IndexedEndpointType ssoPostEndpoint = metaDataFactory.createIndexedEndpointType();
ssoPostEndpoint.setBinding(SamlConstants.HTTP_POST_BINDING);
ssoPostEndpoint.setLocation(getServiceURL(SamlServiceType.SAML_SINGLE_SIGN_ON_SERVICE));
IDPSSODescriptorType idpSsoDescriptor = metaDataFactory.createIDPSSODescriptorType();
idpSsoDescriptor.getSingleSignOnService().add(ssoRedirectEndpoint);
idpSsoDescriptor.getSingleSignOnService().add(ssoPostEndpoint);
addSloEndpointsToMetaData(idpSsoDescriptor);
idpSsoDescriptor.setWantAuthnRequestsSigned(isWantAuthnRequestsSigned());
idpSsoDescriptor.getProtocolSupportEnumeration().add(SamlConstants.PROTOCOL_NSURI);
addNameIDFormatsToMetaData(idpSsoDescriptor);
addKeyDescriptorToMetaData(idpSsoDescriptor);