KEYCLOAK-5838 Fix comparison in SAMLSloRequestParser and SAMLSloResponseParser

The previous comparison was broken (always returned false)
since it compared the enum value with a string.
Calling `.get()` on the enum value to compare the string this the
given local-part fixes the comparison.

See:
73c82d296e/files/saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/SAMLSloRequestParser.java (xe3bb353ac67565ed):1
73c82d296e/files/saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/SAMLSloResponseParser.java (xdd5c8cb1952defd):1
This commit is contained in:
Thomas Darimont 2017-11-11 21:24:17 +01:00
parent 0dfbe01c73
commit 71df504834
2 changed files with 3 additions and 2 deletions

View file

@ -86,7 +86,8 @@ public class SAMLSloRequestParser extends SAMLRequestAbstractParser implements P
* @see {@link ParserNamespaceSupport#supports(QName)}
*/
public boolean supports(QName qname) {
return PROTOCOL_NSURI.get().equals(qname.getNamespaceURI()) && JBossSAMLConstants.LOGOUT_REQUEST.equals(qname.getLocalPart());
return PROTOCOL_NSURI.get().equals(qname.getNamespaceURI())
&& JBossSAMLConstants.LOGOUT_REQUEST.get().equals(qname.getLocalPart());
}
/**

View file

@ -75,6 +75,6 @@ public class SAMLSloResponseParser extends SAMLStatusResponseTypeParser implemen
*/
public boolean supports(QName qname) {
return JBossSAMLURIConstants.PROTOCOL_NSURI.get().equals(qname.getNamespaceURI())
&& LOGOUT_RESPONSE.equals(qname.getLocalPart());
&& LOGOUT_RESPONSE.get().equals(qname.getLocalPart());
}
}