But this is not entirely correct. You are using
AUTHORIZATION_METHOD_HEADER_BEARER
.
PHP:
elseif (static::AUTHORIZATION_METHOD_HEADER_BEARER === $this->getAuthorizationMethod()) {
$extraHeaders = array_merge(array('Authorization' => 'Bearer ' . $token->getAccessToken()), $extraHeaders);
}
Learn how to navigate the resources provided by the GitHub API.
docs.github.com
You can enable other users to authorize your OAuth App.
docs.github.com
if you will see this links, it will be clearly visible
OAuth2 token (sent in a header)
$ curl -H "Authorization: token
OAUTH-TOKEN"
https://api.github.com
and
3. Use the access token to access the API
The access token allows you to make requests to the API on a behalf of a user.
Authorization: token OAUTH-TOKEN
GET
https://api.github.com/user
For example, in curl you can set the Authorization header like this:
curl -H "Authorization: token OAUTH-TOKEN" https://api.github.com/user
But in the header you pass bearer
What would be correct to transmit like
$extraHeaders = array_merge(array('Authorization' => 'token ' . $token->getAccessToken()), $extraHeaders);
But bearer is passed