protected function get_user_oauth_client($overrideurl = false) {
        if ($this->client) {
            return $this->client;
        }
        if ($overrideurl) {
            $returnurl = $overrideurl;
        } else {
            $returnurl = new moodle_url('/repository/repository_callback.php');
            $returnurl->param('callback', 'yes');
            $returnurl->param('repo_id', $this->id);
            $returnurl->param('sesskey', sesskey());
        }
        $this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES);
        return $this->client;
    }
protected function get_user_oauth_client($overrideurl = false) {
        if ($this->client) {
            return $this->client;
        }
        if ($overrideurl) {
            $returnurl = $overrideurl;
        } else {
            $returnurl = new moodle_url('/repository/repository_callback.php');
            $returnurl->param('callback', 'yes');
            $returnurl->param('repo_id', $this->id);
            $returnurl->param('sesskey', sesskey());
        }
        $this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES);
        return $this->client;
    }
protected function get_user_oauth_client ( $ overrideurl = false ) { if ( $ this -> client ) { return $ this -> client ; } if ( $ overrideurl ) { $ returnurl = $ overrideurl ; } else { $ returnurl = new moodle_url ( '/repository/repository_callback.php' ) ; $ returnurl -> param ( 'callback' , 'yes' ) ; $ returnurl -> param ( 'repo_id' , $ this -> id ) ; $ returnurl -> param ( 'sesskey' , sesskey ( ) ) ; } $ this -> client = \ core \ oauth2 \ api :: get_user_oauth_client ( $ this -> issuer , $ returnurl , self :: SCOPES ) ; return $ this -> client ; }
Get a cached user authenticated oauth client.

@param bool|moodle_url $overrideurl Use this url instead of the repo callback.
@return \core\oauth2\client
Get a cached user authenticated oauth client .