code: protected void verifyAuthenticationContextSignature(final MessageContext ctx,
                                                          final HttpServletRequest request,
                                                          final RequestAbstractType authnRequest,
                                                          final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) throws Exception {
          if (!SAMLBindingSupport.isMessageSigned(ctx)) {
              LOGGER.debug("The authentication context is not signed");
              if (adaptor.isAuthnRequestsSigned()) {
                  LOGGER.error("Metadata for [{}] says authentication requests are signed, yet authentication request is not", adaptor.getEntityId());
                  throw new SAMLException("AuthN request is not signed but should be");
              }
              LOGGER.debug("Authentication request is not signed, so there is no need to verify its signature.");
          } else {
              LOGGER.debug("The authentication context is signed; Proceeding to validate signatures...");
              samlProfileHandlerConfigurationContext.getSamlObjectSignatureValidator().verifySamlProfileRequestIfNeeded(authnRequest, adaptor, request, ctx);
          }
      }
docs: Verify authentication context signature.
  
  @param ctx          the authentication context
  @param request      the request
  @param authnRequest the authn request
  @param adaptor      the adaptor
  @throws Exception the exception