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
minor KnpLabs#1017 Update integration authentication documentation for usage with lcobucci/jwt ^4 (glaubinix)
This PR was squashed before being merged into the 3.4.x-dev branch.
Discussion
----------
The security docs were mentioning `lcobucci/jwt:^3.4` which doesn't support php 8. Updated the security docs to reflect all necessary changes to work with `lcobucci/jwt:^4.1`
Passing `ChainedFormatter::withUnixTimestampDates()` to the builder method is necessary because otherwise all dates will be format via `$date->format('U.u')` as microseconds. GitHub expects unix timestamps and will return a 401 response with `'Expiration time' claim ('exp') must be a numeric value representing the future time at which the assertion expires`.
Commits
-------
917192c Update integration authentication documentation for usage with lcobucci/jwt ^4
73dea74 Docs: add builder to JWT authentication
Copy file name to clipboardExpand all lines: doc/security.md
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -37,14 +37,18 @@ 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 3.4](https://github.com/lcobucci/jwt/tree/3.4)
40
+
The following sample code authenticates as an installation using [lcobucci/jwt 4.1](https://github.com/lcobucci/jwt/tree/4.1.x)
41
41
to generate a JSON Web Token (JWT).
42
42
43
43
```php
44
+
use Github\HttpClient\Builder;
44
45
use Lcobucci\JWT\Configuration;
46
+
use Lcobucci\JWT\Encoding\ChainedFormatter;
45
47
use Lcobucci\JWT\Signer\Key\LocalFileReference;
46
48
use Lcobucci\JWT\Signer\Rsa\Sha256;
47
49
50
+
$builder = new Builder();
51
+
48
52
$github = new Github\Client($builder, 'machine-man-preview');
0 commit comments