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
@@ -55,30 +55,30 @@ and installation access token which is then usable with `Github\Client::AUTH_ACC
55
55
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.
56
56
It´s important for integration requests to use the custom Accept header `application/vnd.github.machine-man-preview`.
57
57
58
-
The following sample code authenticates as an installation using [lcobucci/jwt](https://github.com/lcobucci/jwt/tree/3.3.2)
58
+
The following sample code authenticates as an installation using [lcobucci/jwt 3.4](https://github.com/lcobucci/jwt/tree/3.4)
59
59
to generate a JSON Web Token (JWT).
60
60
61
61
```php
62
-
use Http\Adapter\Guzzle6\Client as GuzzleClient;
63
-
use Lcobucci\JWT\Builder;
64
-
use Lcobucci\JWT\Signer\Key;
62
+
use Lcobucci\JWT\Configuration;
63
+
use Lcobucci\JWT\Signer\Key\LocalFileReference;
65
64
use Lcobucci\JWT\Signer\Rsa\Sha256;
66
65
67
-
$builder = new Github\HttpClient\Builder(new GuzzleClient());
68
66
$github = new Github\Client($builder, 'machine-man-preview');
69
67
70
-
$jwt = (new Builder)
71
-
->setIssuer($integrationId)
72
-
->setIssuedAt(time())
73
-
->setExpiration(time() + 60)
74
-
// `file://` prefix for file path or file contents itself
75
-
->sign(new Sha256(), new Key('file:///path/to/integration.private-key.pem'))
0 commit comments