Search in sources :

Example 1 with RoleDescriptorResolver

use of org.opensaml.saml.metadata.resolver.RoleDescriptorResolver in project cas by apereo.

the class SamlObjectSignatureValidator method verifySamlProfileRequestIfNeeded.

/**
     * Verify saml profile request if needed.
     *
     * @param profileRequest the profile request
     * @param resolver       the resolver
     * @param request        the request
     * @param context        the context
     * @throws Exception the exception
     */
public void verifySamlProfileRequestIfNeeded(final RequestAbstractType profileRequest, final MetadataResolver resolver, final HttpServletRequest request, final MessageContext context) throws Exception {
    final RoleDescriptorResolver roleDescriptorResolver = getRoleDescriptorResolver(resolver, context, profileRequest);
    LOGGER.debug("Validating signature for [{}]", profileRequest.getClass().getName());
    final Signature signature = profileRequest.getSignature();
    if (signature != null) {
        validateSignatureOnProfileRequest(profileRequest, signature, roleDescriptorResolver);
    } else {
        validateSignatureOnAuthenticationRequest(profileRequest, request, context, roleDescriptorResolver);
    }
}
Also used : BasicRoleDescriptorResolver(org.opensaml.saml.metadata.resolver.impl.BasicRoleDescriptorResolver) RoleDescriptorResolver(org.opensaml.saml.metadata.resolver.RoleDescriptorResolver) Signature(org.opensaml.xmlsec.signature.Signature)

Aggregations

RoleDescriptorResolver (org.opensaml.saml.metadata.resolver.RoleDescriptorResolver)1 BasicRoleDescriptorResolver (org.opensaml.saml.metadata.resolver.impl.BasicRoleDescriptorResolver)1 Signature (org.opensaml.xmlsec.signature.Signature)1