diff --git a/services/src/main/java/org/keycloak/protocol/saml/installation/SamlIDPDescriptorClientInstallation.java b/services/src/main/java/org/keycloak/protocol/saml/installation/SamlIDPDescriptorClientInstallation.java
index 43a712e0c9..5d155d2e5e 100755
--- a/services/src/main/java/org/keycloak/protocol/saml/installation/SamlIDPDescriptorClientInstallation.java
+++ b/services/src/main/java/org/keycloak/protocol/saml/installation/SamlIDPDescriptorClientInstallation.java
@@ -47,30 +47,40 @@ public class SamlIDPDescriptorClientInstallation implements ClientInstallationPr
" \n";
if (samlClient.forceNameIDFormat() && samlClient.getNameIDFormat() != null) {
- idp += " " + samlClient.getNameIDFormat();
+ idp += " " + samlClient.getNameIDFormat() + "\n";
} else {
- idp += " urn:oasis:names:tc:SAML:2.0:nameid-format:persistent\n" +
- " urn:oasis:names:tc:SAML:2.0:nameid-format:transient\n" +
- " urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified\n" +
- " urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\n";
+ idp += " urn:oasis:names:tc:SAML:2.0:nameid-format:persistent\n" +
+ " urn:oasis:names:tc:SAML:2.0:nameid-format:transient\n" +
+ " urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified\n" +
+ " urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\n";
}
String bindUrl = RealmsResource.protocolUrl(UriBuilder.fromUri(serverBaseUri)).build(realm.getName(), SamlProtocol.LOGIN_PROTOCOL).toString();
idp += "\n" +
" \n" +
- " \n";
+ if (!samlClient.forcePostBinding()) {
+ idp += " \n";
+
+ }
+ idp += " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " + realm.getCertificatePem() + "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
+ " Location=\"" + bindUrl + "\" />\n";
+ if (!samlClient.forcePostBinding()) {
+ idp += " \n";
+ }
+ idp += " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " " + realm.getCertificatePem() + "\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
"\n";
return idp;
}
diff --git a/services/src/main/resources/idp-metadata-template.xml b/services/src/main/resources/idp-metadata-template.xml
index f2cba1134c..5581ab0a90 100755
--- a/services/src/main/resources/idp-metadata-template.xml
+++ b/services/src/main/resources/idp-metadata-template.xml
@@ -33,8 +33,11 @@
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="${idp.sso.HTTP-Redirect}" />
+ Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
+ Location="${idp.sls.HTTP-POST}" />
+