code: public static void setCurrentAuthentication(Authentication authentication) {
          RequestContext context = RequestContext.getCurrent();
          if (context != null) {
              setAuthentication(context.getRequest(), authentication);
          }
      }
docs: Sets the authentication attribute in the current request.
  
  @param authentication    the authentication object to set as request attribute