Skip to content

Commit bb7f589

Browse files
authored
Merge pull request #280 from jzuijlek/issue_279_authnrequest_protocolbinding
Make ProtocolBinding in the AuthnRequest configurable
2 parents 2f65c68 + e33d17b commit bb7f589

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/src/main/java/com/onelogin/saml2/authn/AuthnRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ private StrSubstitutor generateSubstitutor(Saml2Settings settings) {
224224
valueMap.put("issueInstant", issueInstantString);
225225
valueMap.put("id", String.valueOf(id));
226226
valueMap.put("assertionConsumerServiceURL", String.valueOf(settings.getSpAssertionConsumerServiceUrl()));
227+
valueMap.put("protocolBinding", settings.getSpAssertionConsumerServiceBinding());
227228
valueMap.put("spEntityid", settings.getSpEntityId());
228229

229230
String requestedAuthnContextStr = "";
@@ -247,7 +248,7 @@ private StrSubstitutor generateSubstitutor(Saml2Settings settings) {
247248
*/
248249
private static StringBuilder getAuthnRequestTemplate() {
249250
StringBuilder template = new StringBuilder();
250-
template.append("<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\" ID=\"${id}\" Version=\"2.0\" IssueInstant=\"${issueInstant}\"${providerStr}${forceAuthnStr}${isPassiveStr}${destinationStr} ProtocolBinding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" AssertionConsumerServiceURL=\"${assertionConsumerServiceURL}\">");
251+
template.append("<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\" ID=\"${id}\" Version=\"2.0\" IssueInstant=\"${issueInstant}\"${providerStr}${forceAuthnStr}${isPassiveStr}${destinationStr} ProtocolBinding=\"${protocolBinding}\" AssertionConsumerServiceURL=\"${assertionConsumerServiceURL}\">");
251252
template.append("<saml:Issuer>${spEntityid}</saml:Issuer>");
252253
template.append("${subjectStr}${nameIDPolicyStr}${requestedAuthnContextStr}</samlp:AuthnRequest>");
253254
return template;

0 commit comments

Comments
 (0)