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](
5454to generate a JSON Web Token (JWT).
5555
5656``` php
57+ use Lcobucci\JWT\Builder;
58+ use Lcobucci\JWT\Signer\Key;
59+ use Lcobucci\JWT\Signer\Rsa\Sha256;
60+
5761$builder = new Github\HttpClient\Builder(new GuzzleClient());
5862$github = new Github\Client($builder, 'machine-man-preview');
5963
6064$jwt = (new Builder)
6165 ->setIssuer($integrationId)
6266 ->setIssuedAt(time())
6367 ->setExpiration(time() + 60)
64- ->sign(new Sha256(), ( new Keychain)->getPrivateKey($pemPrivateKeyPath ))
68+ ->sign(new Sha256(), new Key('file:///path/to/integration.private-key.pem' ))
6569 ->getToken();
6670
6771$github->authenticate($jwt, null, Github\Client::AUTH_JWT);
You can’t perform that action at this time.
0 commit comments