} else {
getPolicyAsserter().assertPolicy(new QName(namespace, SPConstants.REQUIRE_KEY_IDENTIFIER_REFERENCE));
}
}
if (samlToken.getSamlTokenType() != null) {
final SamlAssertionWrapper samlAssertionWrapper = samlTokenSecurityEvent.getSamlAssertionWrapper();
switch (samlToken.getSamlTokenType()) {
case WssSamlV11Token10:
if (samlAssertionWrapper.getSamlVersion() != SAMLVersion.VERSION_11) {
setErrorMessage("Policy enforces SamlVersion11Profile10 but we got " + samlAssertionWrapper.getSamlVersion());
getPolicyAsserter().unassertPolicy(new QName(namespace, samlToken.getSamlTokenType().name()),
getErrorMessage());
return false;
}
getPolicyAsserter().assertPolicy(new QName(namespace, samlToken.getSamlTokenType().name()));
break;
case WssSamlV11Token11:
if (samlAssertionWrapper.getSamlVersion() != SAMLVersion.VERSION_11) {
setErrorMessage("Policy enforces SamlVersion11Profile11 but we got " + samlAssertionWrapper.getSamlVersion());
getPolicyAsserter().unassertPolicy(new QName(namespace, samlToken.getSamlTokenType().name()),
getErrorMessage());
return false;
}
getPolicyAsserter().assertPolicy(new QName(namespace, samlToken.getSamlTokenType().name()));
break;
case WssSamlV20Token11:
if (samlAssertionWrapper.getSamlVersion() != SAMLVersion.VERSION_20) {
setErrorMessage("Policy enforces SamlVersion20Profile11 but we got " + samlAssertionWrapper.getSamlVersion());
getPolicyAsserter().unassertPolicy(new QName(namespace, samlToken.getSamlTokenType().name()),
getErrorMessage());
return false;
}
getPolicyAsserter().assertPolicy(new QName(namespace, samlToken.getSamlTokenType().name()));