getTrustStore(cb.getRuntimeProperties());
cb.setValidator(certValidator);
} else if (callbacks[i] instanceof DynamicPolicyCallback) {
DynamicPolicyCallback dp = (DynamicPolicyCallback) callbacks[i];
SecurityPolicy policy = dp.getSecurityPolicy();
if (policy instanceof AuthenticationTokenPolicy.SAMLAssertionBinding) {
AuthenticationTokenPolicy.SAMLAssertionBinding samlBinding =
(AuthenticationTokenPolicy.SAMLAssertionBinding) ((AuthenticationTokenPolicy.SAMLAssertionBinding) policy).clone();
if ((samlBinding.getAssertion() == null) && (samlBinding.getAuthorityBinding() == null) && (samlBinding.getAssertionReader() == null)) {
populateAssertion(samlBinding, dp);
} else if (samlBinding.getAssertion() != null || samlBinding.getAssertionReader() != null) {
Subject subj =
(Subject) dp.getRuntimeProperties().get(MessageConstants.AUTH_SUBJECT);
validateSAMLAssertion(samlBinding, subj, dp.getRuntimeProperties());
} else if ((samlBinding.getAuthorityBinding() != null) && (samlBinding.getAssertionId() != null)) {
locateSAMLAssertion(samlBinding, dp.getRuntimeProperties());
} else {
log.log(Level.SEVERE, LogStringsMessages.WSS_1506_INVALID_SAML_POLICY());
throw new UnsupportedCallbackException(null, "SAML Assertion not present in the Policy");
}
}