protected Optional<Credentials> internalValidateCredentials(final CallContext ctx, final Credentials credentials) {
        try {
            val newCredentials = this.authenticator.validate(ctx, credentials).orElse(null);
            checkCredentials(ctx, credentials);
            return Optional.ofNullable(newCredentials);
        } catch (CredentialsException e) {
            logger.info("Failed to validate credentials: {}", e.getMessage());
            logger.debug("Failed to validate credentials", e);
            return Optional.empty();
        }
    }
<p>internalValidateCredentials.</p>

@param ctx a {@link CallContext} object
@param credentials a {@link Credentials} object
@return a {@link Optional} object
pac4j-core/src/main/java/org/pac4j/core/client/BaseClient.java