We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2d22344 + 6cb20db commit e94ce3dCopy full SHA for e94ce3d
doc/security.md
@@ -54,14 +54,18 @@ The following sample code authenticates as an installation using [lcobucci/jwt](
54
to generate a JSON Web Token (JWT).
55
56
```php
57
+use Lcobucci\JWT\Builder;
58
+use Lcobucci\JWT\Signer\Key;
59
+use Lcobucci\JWT\Signer\Rsa\Sha256;
60
+
61
$builder = new Github\HttpClient\Builder(new GuzzleClient());
62
$github = new Github\Client($builder, 'machine-man-preview');
63
64
$jwt = (new Builder)
65
->setIssuer($integrationId)
66
->setIssuedAt(time())
67
->setExpiration(time() + 60)
- ->sign(new Sha256(), (new Keychain)->getPrivateKey($pemPrivateKeyPath))
68
+ ->sign(new Sha256(), new Key('file:///path/to/integration.private-key.pem'))
69
->getToken();
70
71
$github->authenticate($jwt, null, Github\Client::AUTH_JWT);
0 commit comments