File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,18 @@ The following sample code authenticates as an installation using [lcobucci/jwt](
54
54
to generate a JSON Web Token (JWT).
55
55
56
56
``` php
57
+ use Lcobucci\JWT\Builder;
58
+ use Lcobucci\JWT\Signer\Key;
59
+ use Lcobucci\JWT\Signer\Rsa\Sha256;
60
+
57
61
$builder = new Github\HttpClient\Builder(new GuzzleClient());
58
62
$github = new Github\Client($builder, 'machine-man-preview');
59
63
60
64
$jwt = (new Builder)
61
65
->setIssuer($integrationId)
62
66
->setIssuedAt(time())
63
67
->setExpiration(time() + 60)
64
- ->sign(new Sha256(), ( new Keychain)->getPrivateKey($pemPrivateKeyPath ))
68
+ ->sign(new Sha256(), new Key('file:///path/to/integration.private-key.pem' ))
65
69
->getToken();
66
70
67
71
$github->authenticate($jwt, null, Github\Client::AUTH_JWT);
You can’t perform that action at this time.
0 commit comments