WordPress at a glance
function is not described

WC_REST_Authentication::authenticate() public WC 1.0

Authenticate user.

{} It's a method of the class: WC_REST_Authentication{}

No Hooks.

Return

Int|false. Nothing.

Usage

$WC_REST_Authentication = new WC_REST_Authentication();
$WC_REST_Authentication->authenticate( $user_id );
$user_id(int|false) (required)
User ID if one has been determined, false otherwise.

Code of WC_REST_Authentication::authenticate() WC 5.4.1

<?php
public function authenticate( $user_id ) {
	// Do not authenticate twice and check if is a request to our endpoint in the WP REST API.
	if ( ! empty( $user_id ) || ! $this->is_request_to_rest_api() ) {
		return $user_id;
	}

	if ( is_ssl() ) {
		$user_id = $this->perform_basic_authentication();
	}

	if ( $user_id ) {
		return $user_id;
	}

	return $this->perform_oauth_authentication();
}