42 SamlClient samlClient =
new SamlClient(client);
43 String assertionUrl = client.getAttribute(SamlProtocol.SAML_ASSERTION_CONSUMER_URL_POST_ATTRIBUTE);
44 if (assertionUrl == null) assertionUrl = client.getManagementUrl();
45 String logoutUrl = client.getAttribute(SamlProtocol.SAML_SINGLE_LOGOUT_SERVICE_URL_POST_ATTRIBUTE);
46 if (logoutUrl == null) logoutUrl = client.getManagementUrl();
47 String nameIdFormat = samlClient.getNameIDFormat();
48 if (nameIdFormat == null) nameIdFormat = SamlProtocol.SAML_DEFAULT_NAMEID_FORMAT;
49 String spCertificate = SPMetadataDescriptor.xmlKeyInfo(
" ", null, samlClient.getClientSigningCertificate(), KeyTypes.SIGNING.value(),
true);
50 String encCertificate = SPMetadataDescriptor.xmlKeyInfo(
" ", null, samlClient.getClientEncryptingCertificate(), KeyTypes.ENCRYPTION.value(),
true);
51 return SPMetadataDescriptor.getSPDescriptor(JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get(), assertionUrl, logoutUrl,
52 samlClient.requiresClientSignature(), samlClient.requiresAssertionSignature(), samlClient.requiresEncryption(),
53 client.getClientId(), nameIdFormat, spCertificate, encCertificate);