code: @Override
      public Credentials validate(final SAML2MessageContext context) {
  
          final SAMLObject message = context.getMessage();
  
          // IDP-initiated
          if (message instanceof LogoutRequest) {
              final LogoutRequest logoutRequest = (LogoutRequest) message;
              final SignatureTrustEngine engine = this.signatureTrustEngineProvider.build();
              validateLogoutRequest(logoutRequest, context, engine);
  
              return null;
  
          } else if (message instanceof LogoutResponse) {
              // SP-initiated
              final LogoutResponse logoutResponse = (LogoutResponse) message;
              final SignatureTrustEngine engine = this.signatureTrustEngineProvider.build();
              validateLogoutResponse(logoutResponse, context, engine);
  
              // nothing to reply to the logout response
              throw new OkAction("");
  
          } else {
              throw new SAMLException("Must be a LogoutRequest or LogoutResponse type");
          }
      }
docs: Validates the SAML protocol logout request/response.
  
  @param context the context