You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/security.md
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -37,30 +37,30 @@ and installation access token which is then usable with `Github\Client::AUTH_ACC
37
37
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.
38
38
It´s important for integration requests to use the custom Accept header `application/vnd.github.machine-man-preview`.
39
39
40
-
The following sample code authenticates as an installation using [lcobucci/jwt](https://github.com/lcobucci/jwt/tree/3.3.2)
40
+
The following sample code authenticates as an installation using [lcobucci/jwt 3.4](https://github.com/lcobucci/jwt/tree/3.4)
41
41
to generate a JSON Web Token (JWT).
42
42
43
43
```php
44
-
use Http\Adapter\Guzzle6\Client as GuzzleClient;
45
-
use Lcobucci\JWT\Builder;
46
-
use Lcobucci\JWT\Signer\Key;
44
+
use Lcobucci\JWT\Configuration;
45
+
use Lcobucci\JWT\Signer\Key\LocalFileReference;
47
46
use Lcobucci\JWT\Signer\Rsa\Sha256;
48
47
49
-
$builder = new Github\HttpClient\Builder(new GuzzleClient());
50
48
$github = new Github\Client($builder, 'machine-man-preview');
51
49
52
-
$jwt = (new Builder)
53
-
->setIssuer($integrationId)
54
-
->setIssuedAt(time())
55
-
->setExpiration(time() + 60)
56
-
// `file://` prefix for file path or file contents itself
57
-
->sign(new Sha256(), new Key('file:///path/to/integration.private-key.pem'))
0 commit comments