Skip to content

Commit bacb73d

Browse files
minor #892 Don't use deprecated auth in examples (GrahamCampbell)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- `AUTH_HTTP_TOKEN` is deprecated, and all examples should instead use `AUTH_ACCESS_TOKEN`. Commits ------- e851bd0 Don't use deprecated auth in example 5f1e6f7 Update security.md
1 parent 1884306 commit bacb73d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/currentuser/repositories.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ There are three values that can be passed into the `repositories` method: `type`
2525

2626
```php
2727
$client = new \Github\Client();
28-
$client->authenticate($github_token, null, \Github\Client::AUTH_HTTP_TOKEN);
28+
$client->authenticate($github_token, null, \Github\Client::AUTH_ACCESS_TOKEN);
2929
$client->currentUser()->repositories();
3030
```

doc/security.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ Note however that GitHub describes this method as deprecated. In most case you s
5151
### Authenticating as an Integration
5252

5353
To authenticate as an integration you need to supply a JSON Web Token with `Github\Client::AUTH_JWT` to request
54-
and installation access token which is then usable with `Github\Client::AUTH_HTTP_TOKEN`. [Github´s integration
54+
and installation access token which is then usable with `Github\Client::AUTH_ACCESS_TOKEN`. [Github´s integration
5555
authentication docs](https://developer.github.com/apps/building-github-apps/authentication-options-for-github-apps/#authenticating-as-a-github-app) describe the flow in detail.
5656
It´s important for integration requests to use the custom Accept header `application/vnd.github.machine-man-preview`.
5757

58-
The following sample code authenticates as an installation using [lcobucci/jwt](https://github.com/lcobucci/jwt/tree/3.2.0)
58+
The following sample code authenticates as an installation using [lcobucci/jwt](https://github.com/lcobucci/jwt/tree/3.3.2)
5959
to generate a JSON Web Token (JWT).
6060

6161
```php
@@ -78,7 +78,7 @@ $jwt = (new Builder)
7878
$github->authenticate($jwt, null, Github\Client::AUTH_JWT);
7979

8080
$token = $github->api('apps')->createInstallationToken($installationId);
81-
$github->authenticate($token['token'], null, Github\Client::AUTH_HTTP_TOKEN);
81+
$github->authenticate($token['token'], null, Github\Client::AUTH_ACCESS_TOKEN);
8282
```
8383

8484
The `$integrationId` you can find in the about section of your github app.

0 commit comments

Comments
 (0)