docs: protected boolean authenticate(ContainerRequestContext requestContext, @Nullable C credentials, String scheme) {
          try {
              if (credentials == null) {
                  return false;
              }
  
              final Optional<P> principal = authenticator.authenticate(credentials);
              if (!principal.isPresent()) {
                  return false;
              }
  
              final P prince = principal.get();
              final SecurityContext securityContext = requestContext.getSecurityContext();
              final boolean secure = securityContext != null && securityContext.isSecure();
  
              requestContext.setSecurityContext(new SecurityContext() {
                  @Override
                  public Principal getUserPrincipal() {
                      return prince;
                  }
  
                  @Override
                  public boolean isUserInRole(String role) {
                      return authorizer.authorize(prince, role);
                  }
  
                  @Override
                  public boolean isSecure() {
                      return secure;
                  }
  
                  @Override
                  public String getAuthenticationScheme() {
                      return scheme;
                  }
              });
              return true;
          } catch (AuthenticationException e) {
              logger.warn("Error authenticating credentials", e);
              throw new InternalServerErrorException();
          }
      }