socialconnect / jwx
PHP library for JSON web tokens (JWT) and JWT
Installs: 618 181
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 4
Open Issues: 0
pkg:composer/socialconnect/jwx
Requires
- php: ^7.4|^8.0
- ext-json: *
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
Suggests
- ext-openssl: Please install openssl extension to use RS encryption
This package is auto-updated.
Last update: 2025-12-17 15:48:04 UTC
README
Documentation :: Getting Started
Implementation:
Encode
<?php $jwt = new \SocialConnect\JWX\JWT([ 'uid' => 5, ]); $encodeOptions = new \SocialConnect\JWX\EncodeOptions(); $encodeOptions->setExpirationTime(600); $token = $jwt->encode('TEST', 'HS256', $encodeOptions); var_dump($token);
Decode
<?php $decodeOptions = new \SocialConnect\JWX\DecodeOptions(['HS256']); $token = \SocialConnect\JWX\JWT::decode('TEST', $token, $decodeOptions); var_dump($token);
License
This project is open-sourced software licensed under the MIT License.
See the LICENSE file for more information.