OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
lcobucci
/
jwt
/
docs
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:34:18 AM
rwxr-xr-x
📄
configuration.md
5.15 KB
08/12/2024 10:33:26 AM
rw-r--r--
📄
extending-the-library.md
5.33 KB
08/12/2024 10:33:26 AM
rw-r--r--
📄
index.md
645 bytes
08/12/2024 10:33:26 AM
rw-r--r--
📄
installation.md
911 bytes
08/12/2024 10:33:26 AM
rw-r--r--
📄
issuing-tokens.md
2.46 KB
08/12/2024 10:33:26 AM
rw-r--r--
📄
parsing-tokens.md
1 KB
08/12/2024 10:33:26 AM
rw-r--r--
📄
upgrading.md
11.35 KB
08/12/2024 10:33:26 AM
rw-r--r--
📄
validating-tokens.md
2.84 KB
08/12/2024 10:33:26 AM
rw-r--r--
Editing: parsing-tokens.md
Close
# Parsing tokens !!! Note The examples here fetch the configuration object from a hypothetical dependency injection container. You can create it in the same script or require it from a different file. It basically depends on how your system is bootstrapped. To parse a token you must create a new parser (easier when using the [configuration object](configuration.md)) and ask it to parse a string: ```php use Lcobucci\JWT\Configuration; use Lcobucci\JWT\Token\Plain; $config = $container->get(Configuration::class); assert($config instanceof Configuration); $token = $config->parser()->parse( 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.' . 'eyJzdWIiOiIxMjM0NTY3ODkwIn0.' . '2gSBz9EOsQRN9I-3iSxJoFt7NtgV6Rm0IL6a8CAwl3Q' ); assert($token instanceof Plain); $token->headers(); // Retrieves the token headers $token->claims(); // Retrieves the token claims ``` !!! Important In case of parsing errors the Parser will throw an exception of type `InvalidArgumentException`.