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: advanced-topics/nested-tokens.md
-2
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,6 @@ The `NestedTokenLoader` and `NestedTokenBuilder` classes will help you to create
7
7
*`web-token/jwt-checker`
8
8
*`web-token/jwt-signature`
9
9
10
-
**New in version 2.0**: a new package is available: `web-token/jwt-nested-token`. This package contains all the classes and dependencies will be directly managed by composer. You can install it if needed.
11
-
12
10
## Nested Token Loading
13
11
14
12
To instantiate the `NestedTokenLoader`, you need a `JWSLoader` and a `JWELoader`.
@@ -28,10 +28,14 @@ $claimCheckerManager = new ClaimCheckerManager(
28
28
);
29
29
```
30
30
31
-
When instantiated, call the method `check` to check the claims of a JWT object. This method only accept an associative array. You have to retrieve this array by converting the JWT payload.
31
+
When instantiated, call the method `check` to check the claims of a JWT object. This method only accept an array. You have to retrieve this array by converting the JWT payload.
32
32
33
33
```php
34
-
$claims = json_decode($jwt->getPayload(), true);
34
+
use Jose\Component\Core\Converter\StandardConverter;
new AlgorithmChecker(['HS256']), // We check the header "alg" (algorithm)
34
34
],
@@ -87,8 +87,6 @@ The following header checkers are provided:
87
87
88
88
If you need, you can create you own header checker. It must implement the interface `Jose\Component\Checker\HeaderChecker`. In the following example, we will check that the protected header parameter `custom` is an array with value `foo` or `bar`.
0 commit comments