PHP package for JWT

Overview

Build Status Latest Stable Version Total Downloads License

PHP-JWT

A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to RFC 7519.

Installation

Use composer to manage your dependencies and download PHP-JWT:

composer require firebase/php-jwt

Optionally, install the paragonie/sodium_compat package from composer if your php is < 7.2 or does not have libsodium installed:

composer require paragonie/sodium_compat

Example

use Firebase\JWT\JWT;
use Firebase\JWT\Key;

$key = "example_key";
$payload = array(
    "iss" => "http://example.org",
    "aud" => "http://example.com",
    "iat" => 1356999524,
    "nbf" => 1357000000
);

/**
 * IMPORTANT:
 * You must specify supported algorithms for your application. See
 * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40
 * for a list of spec-compliant algorithms.
 */
$jwt = JWT::encode($payload, $key, 'HS256');
$decoded = JWT::decode($jwt, new Key($key, 'HS256'));

print_r($decoded);

/*
 NOTE: This will now be an object instead of an associative array. To get
 an associative array, you will need to cast it as such:
*/

$decoded_array = (array) $decoded;

/**
 * You can add a leeway to account for when there is a clock skew times between
 * the signing and verifying servers. It is recommended that this leeway should
 * not be bigger than a few minutes.
 *
 * Source: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#nbfDef
 */
JWT::$leeway = 60; // $leeway in seconds
$decoded = JWT::decode($jwt, new Key($key, 'HS256'));

Example with RS256 (openssl)

use Firebase\JWT\JWT;
use Firebase\JWT\Key;

$privateKey = <<<EOD
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQC8kGa1pSjbSYZVebtTRBLxBz5H4i2p/llLCrEeQhta5kaQu/Rn
vuER4W8oDH3+3iuIYW4VQAzyqFpwuzjkDI+17t5t0tyazyZ8JXw+KgXTxldMPEL9
5+qVhgXvwtihXC1c5oGbRlEDvDF6Sa53rcFVsYJ4ehde/zUxo6UvS7UrBQIDAQAB
AoGAb/MXV46XxCFRxNuB8LyAtmLDgi/xRnTAlMHjSACddwkyKem8//8eZtw9fzxz
bWZ/1/doQOuHBGYZU8aDzzj59FZ78dyzNFoF91hbvZKkg+6wGyd/LrGVEB+Xre0J
Nil0GReM2AHDNZUYRv+HYJPIOrB0CRczLQsgFJ8K6aAD6F0CQQDzbpjYdx10qgK1
cP59UHiHjPZYC0loEsk7s+hUmT3QHerAQJMZWC11Qrn2N+ybwwNblDKv+s5qgMQ5
5tNoQ9IfAkEAxkyffU6ythpg/H0Ixe1I2rd0GbF05biIzO/i77Det3n4YsJVlDck
ZkcvY3SK2iRIL4c9yY6hlIhs+K9wXTtGWwJBAO9Dskl48mO7woPR9uD22jDpNSwe
k90OMepTjzSvlhjbfuPN1IdhqvSJTDychRwn1kIJ7LQZgQ8fVz9OCFZ/6qMCQGOb
qaGwHmUK6xzpUbbacnYrIM6nLSkXgOAwv7XXCojvY614ILTK3iXiLBOxPu5Eu13k
eUz9sHyD6vkgZzjtxXECQAkp4Xerf5TGfQXGXhxIX52yH+N2LtujCdkQZjXAsGdm
B2zNzvrlgRmgBrklMTrMYgm1NPcW+bRLGcwgW2PTvNM=
-----END RSA PRIVATE KEY-----
EOD;

$publicKey = <<<EOD
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8kGa1pSjbSYZVebtTRBLxBz5H
4i2p/llLCrEeQhta5kaQu/RnvuER4W8oDH3+3iuIYW4VQAzyqFpwuzjkDI+17t5t
0tyazyZ8JXw+KgXTxldMPEL95+qVhgXvwtihXC1c5oGbRlEDvDF6Sa53rcFVsYJ4
ehde/zUxo6UvS7UrBQIDAQAB
-----END PUBLIC KEY-----
EOD;

$payload = array(
    "iss" => "example.org",
    "aud" => "example.com",
    "iat" => 1356999524,
    "nbf" => 1357000000
);

$jwt = JWT::encode($payload, $privateKey, 'RS256');
echo "Encode:\n" . print_r($jwt, true) . "\n";

$decoded = JWT::decode($jwt, new Key($publicKey, 'RS256'));

/*
 NOTE: This will now be an object instead of an associative array. To get
 an associative array, you will need to cast it as such:
*/

$decoded_array = (array) $decoded;
echo "Decode:\n" . print_r($decoded_array, true) . "\n";

Example with a passphrase

use Firebase\JWT\JWT;
use Firebase\JWT\Key;

// Your passphrase
$passphrase = '[YOUR_PASSPHRASE]';

// Your private key file with passphrase
// Can be generated with "ssh-keygen -t rsa -m pem"
$privateKeyFile = '/path/to/key-with-passphrase.pem';

// Create a private key of type "resource"
$privateKey = openssl_pkey_get_private(
    file_get_contents($privateKeyFile),
    $passphrase
);

$payload = array(
    "iss" => "example.org",
    "aud" => "example.com",
    "iat" => 1356999524,
    "nbf" => 1357000000
);

$jwt = JWT::encode($payload, $privateKey, 'RS256');
echo "Encode:\n" . print_r($jwt, true) . "\n";

// Get public key from the private key, or pull from from a file.
$publicKey = openssl_pkey_get_details($privateKey)['key'];

$decoded = JWT::decode($jwt, new Key($publicKey, 'RS256'));
echo "Decode:\n" . print_r((array) $decoded, true) . "\n";

Example with EdDSA (libsodium and Ed25519 signature)

use Firebase\JWT\JWT;
use Firebase\JWT\Key;

// Public and private keys are expected to be Base64 encoded. The last
// non-empty line is used so that keys can be generated with
// sodium_crypto_sign_keypair(). The secret keys generated by other tools may
// need to be adjusted to match the input expected by libsodium.

$keyPair = sodium_crypto_sign_keypair();

$privateKey = base64_encode(sodium_crypto_sign_secretkey($keyPair));

$publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair));

$payload = array(
    "iss" => "example.org",
    "aud" => "example.com",
    "iat" => 1356999524,
    "nbf" => 1357000000
);

$jwt = JWT::encode($payload, $privateKey, 'EdDSA');
echo "Encode:\n" . print_r($jwt, true) . "\n";

$decoded = JWT::decode($jwt, new Key($publicKey, 'EdDSA'));
echo "Decode:\n" . print_r((array) $decoded, true) . "\n";

Using JWKs

use Firebase\JWT\JWK;
use Firebase\JWT\JWT;

// Set of keys. The "keys" key is required. For example, the JSON response to
// this endpoint: https://www.gstatic.com/iap/verify/public_key-jwk
$jwks = ['keys' => []];

// JWK::parseKeySet($jwks) returns an associative array of **kid** to private
// key. Pass this as the second parameter to JWT::decode.
JWT::decode($payload, JWK::parseKeySet($jwks));

Changelog

5.0.0 / 2017-06-26

4.0.0 / 2016-07-17

  • Add support for late static binding. See #88 for details. Thanks to @chappy84!
  • Use static $timestamp instead of time() to improve unit testing. See #93 for details. Thanks to @josephmcdermott!
  • Fixes to exceptions classes. See #81 for details. Thanks to @Maks3w!
  • Fixes to PHPDoc. See #76 for details. Thanks to @akeeman!

3.0.0 / 2015-07-22

  • Minimum PHP version updated from 5.2.0 to 5.3.0.
  • Add \Firebase\JWT namespace. See #59 for details. Thanks to @Dashron!
  • Require a non-empty key to decode and verify a JWT. See #60 for details. Thanks to @sjones608!
  • Cleaner documentation blocks in the code. See #62 for details. Thanks to @johanderuijter!

2.2.0 / 2015-06-22

  • Add support for adding custom, optional JWT headers to JWT::encode(). See #53 for details. Thanks to @mcocaro!

2.1.0 / 2015-05-20

  • Add support for adding a leeway to JWT:decode() that accounts for clock skew between signing and verifying entities. Thanks to @lcabral!
  • Add support for passing an object implementing the ArrayAccess interface for $keys argument in JWT::decode(). Thanks to @aztech-dev!

2.0.0 / 2015-04-01

  • Note: It is strongly recommended that you update to > v2.0.0 to address known security vulnerabilities in prior versions when both symmetric and asymmetric keys are used together.
  • Update signature for JWT::decode(...) to require an array of supported algorithms to use when verifying token signatures.

Tests

Run the tests using phpunit:

$ pear install PHPUnit
$ phpunit --configuration phpunit.xml.dist
PHPUnit 3.7.10 by Sebastian Bergmann.
.....
Time: 0 seconds, Memory: 2.50Mb
OK (5 tests, 5 assertions)

New Lines in private keys

If your private key contains \n characters, be sure to wrap it in double quotes "" and not single quotes '' in order to properly interpret the escaped characters.

License

3-Clause BSD.

Comments
  • Adding JWK support

    Adding JWK support

    This PR introduces changes made in the fork https://github.com/fproject/php-jwt to add support for JWKs, so that a fork is no longer needed. I didn't change the code from that repo apart from updating the docblock at the top of the JWK class, and breaking out the JWK tests into a new file JWKTest.php. Some spacing was also added to those tests to make the arrange/act/assert pattern clear.

    I haven't done a ton of manual testing on this, but I assume since the fproject fork has been used, this is a working implementation (and the unit tests pass of course).

    Fixes #70.

    I know it's a bit weird to make a PR for someone else's code, but since there didn't seem to be any movement on #70 for making one I figured I'd start one so there can be a discussion about what further changes need to be made before this feature can be added to this repo.

    cla: yes 
    opened by EricTendian 24
  • Invalid Custom TOken

    Invalid Custom TOken

    Im using custom token auth on Firebase. I tried to generate token as the documentation said. But when i try to login in client side with (loginWithCustomToken(token)) method it gives an error below

    {
     "error": {
      "errors": [
       {
        "domain": "global",
        "reason": "invalid",
        "message": "INVALID_CUSTOM_TOKEN"
       }
      ],
      "code": 400,
      "message": "INVALID_CUSTOM_TOKEN"
     }
    }
    

    I generate token with this code block as described in firebase documentation

    $service_account_email = "USED_FROM_JSON_FILE"; //
    $private_key = "USED_FROM_JSON_FILE";
    
    function create_custom_token($uid, $is_premium_account) {
      global $service_account_email, $private_key;
    
      $now_seconds = time();
      $payload = array(
        "iss" => $service_account_email,
        "sub" => $service_account_email,
        "aud" => "https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.IdentityToolkit",
        "iat" => $now_seconds,
        "exp" => $now_seconds+(60*60),  // Maximum expiration time is one hour
        "uid" => $uid,
        "claims" => array(
          "premium_account" => $is_premium_account
        )
      );
      return JWT::encode($payload, $private_key, "RS256");
    }
    
    opened by kadircanerergun 20
  • Feature request - decode without verifcation

    Feature request - decode without verifcation

    Would be nice to be able to decode the jwt without needing to verify the signature.

    Eg, if you need to do additional processing when the jwt is expired.

    Something like this:

    public function decode($jwt, $verify = true)

    opened by amnah 18
  • Caching Responses of JWKS

    Caching Responses of JWKS

    Working with JWKS can have a serious impact on performance if the signing key is fetched on every request.

    While fetching the Keys currently is left to the app specific implementation shouldn't fetching and caching the response from an external resource be something firebase/php-jwt should do?

    Auth0 suggests to implement caching and .Net 6 seems to do it as well:

    https://community.auth0.com/t/caching-jwks-signing-key/17654/2 https://github.com/auth0/node-jwks-rsa#caching

    Taking all considerations into account and implement it here eliminates doing it over and over again.

    Maybe (optionally) using https://packagist.org/packages/psr/simple-cache as a simple cache interface would be the way to go?

    enhancement v6.1 
    opened by swiffer 14
  • How to verify a jwt ?

    How to verify a jwt ?

    Suppose I get a jwt string xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxx

    Now, how will I verify this jwt ???

    How will I convert this string back to an array to decode / verify it ? @bshaffer @mbleigh @ultrasaurus

    opened by mridah 14
  • Signature verification failed

    Signature verification failed

    Hello all, I have a problem in verifying the following signature in php-jwt, it is successfully verified using jwt.io website, the problem appears just when I try to verify it using php-jwt. I'm not sure if I missed something, could you tell me for any solution.

    eyJhbGciOiAiSFMyNTYiLCJ0eXAiOiAiSldUIn0=.eyJ0aW1lIjoxNDI4OTQyMDcxLCJzdHIiOiJrYXJ0YWwiLCJsYW5ndWFnZSI6InRyIn0=.k4ZteQMHOs+43YxakNjuDfqevgFSmgwEykrgHxO1Uic=

    opened by ghost 14
  • v5.5.0 JWT::decode() signature breaks backward compatibility

    v5.5.0 JWT::decode() signature breaks backward compatibility

    The Firebase\JWT::decode() method signature changed for its second argument from string|array|resource to Key|array<Key>, which broke some of our CI builds at their static analysis stage. This has been introduced in v5.5.0 with https://github.com/firebase/php-jwt/commit/bc0df6440dfe4099266a44e99a2839a1856b8ec0. We're going to lock our version dependency at >=5.0 <5.5 but would like to know if this will be reverted or not ?

    opened by AymDev 13
  • feat!: Require Key object when decoding JWT objects

    feat!: Require Key object when decoding JWT objects

    see #352 and #351

    Builds off https://github.com/firebase/php-jwt/pull/365, but requires the changes (to be tagged in v6) for better security

    • BC Breaking - requires the use of Firebase\JWT\Key when calling JWT::decode instead of passing in the $allowed_algs array.
    • Key accepts a resource, string, or instance of OpenSSLAsymmetricKey
    • JWK now requires the JWK Keyset to have alg set, which is an optional parameter. If there's a straight foward (and reliable) way to detect the algorithm from the other parameters in JWK, we should add this logic as well.

    cc @paragonie-security

    cla: yes v6.0 
    opened by bshaffer 13
  • Add support for determining key based on entire JOSE header

    Add support for determining key based on entire JOSE header

    The specs allow for header paramters such as alg, jwk, jku, x5c, etc., which could have a determining factor in how the key is chosen.

    This PR provides an interface for implementing such logic.

    cla: yes 
    opened by gielfeldt 12
  • Reissue JWT when expired

    Reissue JWT when expired

    I'm storing jwt in a storage. of if client request with expired token which is in my storage then I want to reissue a jwt. but problem is how to get payloads from a expired jwt ?

    opened by ashraful88 12
  • How to catch Expired token

    How to catch Expired token

    I got this Fatal error: Uncaught exception 'Firebase\JWT\ExpiredException' with message 'Expired token' in I try to run try and catch, but it still come out Fatal Error.

    try{
        $decoded = JWT::decode($jwt, $key, array('HS256'));
    }catch(\Exception $e){
         echo 'Caught exception: ',  $e->getMessage(), "\n";
    }
    

    I am using PHP-5.4.36 How to catch this error? Thanks!

    opened by shiroamada 12
  • chore(main): release 6.4.0

    chore(main): release 6.4.0

    opened by release-please[bot] 0
  • The nonstandard

    The nonstandard "no future iat" check is disruptive

    The JWT.php decode() has a nonstandard check to verify that "the time according to the JWT on the issuing server" is not later than "the time on the machine that is verifying the JWT", w/in some apparently statically configured leeway. This presents a problem when the server that signs the JWT has a clock that is ahead of the machine calling decode(), where the code calling decode() is punished by getting an exception thrown, saying a perfectly valid JWT is invalid. The code calling decode() is expected to configure some arbitrary $leeway variable that is likely to break again or sacrifice security.

    More details:

    The firebase php-jwt JWT.php has this line: // Check that this token has been created before 'now'. This prevents // using tokens that have been created for later use (and haven't // correctly used the nbf claim). if (isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) { throw new BeforeValidException( 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat) ); }

    According to the RFC: The "iat" (issued at) claim identifies the time at which the JWT was issued. This claim can be used to determine the age of the JWT. Its value MUST be a number containing a NumericDate value. Use of this claim is OPTIONAL.

    Notice that it says nothing about validating that this timestamp is not "in the future according to the validating machine's time". Enforcing this in the JWT.php code seems like an issue, as I've already seen (it looks like the Sign In With Google server is off by about 2 seconds with my machine). It's unreasonable to assume that it's a server maintainer's fault for getting out of sync with google's server's timestamp. It seems like it would be better, if the 'iat' is in the future, to use this to offset the timestamp, instead of throwing an exception.

    The current workarounds I'm pondering are if I want to set the $timestamp static variable to this offset, to sleep() until 'iat' if it isn't too far in the future, or if I want to just bite the bullet and set the $leeway and cross my fingers that I guessed a good arbitrary leeway value.

    enhancement v7.0 
    opened by gulachek 5
  • Allow overriding default headers

    Allow overriding default headers

    The 'typ' and 'alg' headers are currently set by default, and cannot be overridden with the $head parameter. This change would still keep the default headers, but would allow developers to override it if they so choose.

    One such use case would be to create a JWT of "typ": "passport", as per the stir/shaken requirements.

    opened by mroux 1
  • Please allow overriding alg and typ headers

    Please allow overriding alg and typ headers

    Why would you prevent overriding those headers? They're already set by default, developers should have the option to override them. Especially the "typ" one, what would be the point of that header if it always had to be "JWT"?

    PR: https://github.com/firebase/php-jwt/pull/473

    opened by mroux 1
  • Verifying/Decoding Apple's x5c JWT signatures

    Verifying/Decoding Apple's x5c JWT signatures

    I tried using the auth keys published on Apple's website:

    $signedTransactionJWT = $response['signedTransactions'][0];
    
    $appleKeysText = file_get_contents('https://appleid.apple.com/auth/keys');
    
    $jwks = json_decode($appleKeysText, true);
    $keyset = JWK::parseKeySet($jwks);
    $decodedTransactionPayload = JWT::decode($signedTransactionJWT, $keyset);
    
    

    ...but it horks with the following error:

    Fatal error: Uncaught UnexpectedValueException: "kid" empty, unable to lookup correct key
    

    I looked through the JWT::decode() method, and it's looking for a key id ("kid") in the header of the signed transaction JWT, but Apple doesn't provide a "kid" in the header of the signed transaction JWT. The structure of the header looks like this:

    {
        "alg": "ES256",
        "x5c": [
            "MIIEMDCCA7agAwIBAgIQaPoPldvpSoEH0lBrjDPv9jAKBggqhkjOPQQDAzB1M...",
            "MIIDFjCCApygAwIBAgIUIsGhRwp0c2nvU4YSycafPTjzbNcwCgYIKoZIzj0EA...",
            "MIICQzCCAcmgAwIBAgIILcX8iNLFS5UwCgYIKoZIzj0EAwMwZzEbMBkGA1UEA..."
        ]
    }
    

    I'm an experienced developer in a hundred other topics, but this is my first time working with JWTs, so I'm doing my best to understand the various interacting pieces here.

    How can I properly decode/verify the JWTs with x5c from Apple?

    opened by kennywyland 1
Releases(v6.3.2)
  • v6.3.2(Dec 19, 2022)

  • v6.3.1(Nov 1, 2022)

  • v6.3.0(Jul 15, 2022)

  • v6.2.0(May 13, 2022)

    Features

    1. Added Cached Key Sets (#397)!! See the README for usage instructions

    2. Added $defaultAlg parameter to JWT::parseKey and JWT::parseKeySet (#426). This will allow users to parse JWKS which do not populate the alg parameter without having to manually edit the JSON.

    Source code(tar.gz)
    Source code(zip)
  • v6.1.2(Apr 21, 2022)

    Bug Fix

    • revert the flag to json_decode to force object (https://github.com/firebase/php-jwt/pull/420)

    Note: This fixes the PHP Fatal error the previous version tried to fix, but does so in a safer way.

    Source code(tar.gz)
    Source code(zip)
  • v6.1.1(Apr 15, 2022)

    Bug Fixes

    Add flag to json_decode to force object (#416)

    Note: This technically breaks backwards compatibility, but it fixes a PHP Fatal error in the current release on JWT::decode which also broke backwards compatibility, so we hope it's justified 🤞

    Source code(tar.gz)
    Source code(zip)
  • v6.1.0(Mar 23, 2022)

    Note: There should be no issues with backwards compatibility unless types were being used incorrectly

    • This version is compatible with PHP >= 7.1
    • Drop support for PHP 5.3, 5.4, 5.5, 5.6, and 7.0
    • Add parameter typing and return types
    • Better PHPDoc / IDE support
    Source code(tar.gz)
    Source code(zip)
  • v6.0.0(Jan 24, 2022)

    Note: This version is compatible with PHP >= 5.3

    Backwards Compatibility Breaking Changes

    • The second argument of JWT::decode now must be Firebase\JWT\Key or array<string, Firebase\JWT\Key> (see #376)
    • The return type of Firebase\JWT\JWK::parseKey is now Firebase\JWT\Key (see #392)
    • The return type of Firebase\JWT\JWK::parseKeySet is now array<string, Firebase\JWT\Key> (see #376)
    • The "alg" parameter is required to be set for all JWKS parsed using Firebase\JWT\JWK::parseKeySet (see #376)
    • The flag JSON_UNESCAPED_SLASHES is now used for JSON decoding (see #376)
    • Constants ASN1_INTEGER, ASN1_SEQUENCE, and ASN1_BIT_STRING have been removed (see #376)
    • JWT::encode requires third argument $alg (see #377)
    • JWT::sign requires third argument $alg (see #377)

    Using Firebase\JWT\Key

    Using the Key object in JWT::decode

    As a security fix, to avoid key type confusion (see #351), use of Firebase\JWT\Key is now required when decoding:

    use Firebase\JWT\JWT;
    
    // previous (v5.5.1 and below)
    $decoded = JWT::decode($jwt, $publicKey, 'RS256');
    
    // new (v6.0.0)
    use Firebase\JWT\Key;
    $decoded = JWT::decode($jwt, new Key($publicKey, 'RS256'));
    

    Using the Key object in JWK::parseKey and JWK::parseKeySet

    Calls to JWK::parseKey and JWK::parseKeySet now return a Key object and an array of Key objects respectively.

    use Firebase\JWT\JWK;
    
    // previous (v5.5.1 and below)
    $key = JWK::parseKey($jwk); // $key is a resource
    $keys = JWK::parseKeySet($jwks); // $keys is an associative array key ID to resources
    
    // new (v6.0.0)
    $key = JWK::parseKey($jwk); // $key is a Key object
    $keys = JWK::parseKeySet($jwks); // $keys is an associative array of key ID to Key objects
    

    If the keys in your JWKS do not contain the "alg", you need to set it manually to the expected algorithm, for it to be able to parse successfully:

    // new (v6.0.0) for JWKS which do not contain "alg"
    foreach ($jwks as $k => $jwks) {
        $jwks[$k]['alg'] = 'RS256'; // the expected alg of your JWKS
    }
    $keys = JWK::parseKeySet($jwks); // $keys is an associative array of key ID to Key objects
    
    Source code(tar.gz)
    Source code(zip)
  • v5.5.1(Nov 8, 2021)

    Bug Fixes

    This release fixes BC issues caused by the changes in 5.5.0:

    • Updates PHPDoc for static analyzers (#371)
    • Ensures exceptions are not thrown for keys of type resource or OpenSSLAsymmetricKey (#371)
    Source code(tar.gz)
    Source code(zip)
  • v5.5.0(Nov 4, 2021)

    !!IMPORTANT!!

    The recommended usage of this library has changed. A Key object should now be used as the second argument to JWT::decode instead of using the allowed_algs array. This will prevent key/algorithm type confusion:

    // Previous way to call "decode"
    Firebase\JWT\JWT::decode($jwt, $publicKey, ['RS256']);
    
    // New (safer) way to call "decode"
    $key = new Firebase\JWT\Key($publicKey, 'RS256');
    Firebase\JWT\JWT::decode($jwt, $key);
    

    Please see #351 for more information on the issue, and #365 for the merged changes. The README has also been updated to reflect the new usage.

    Source code(tar.gz)
    Source code(zip)
  • v5.4.0(Jun 23, 2021)

  • v5.3.0(May 31, 2021)

  • v5.2.1(Feb 12, 2021)

  • v5.2.0(Mar 25, 2020)

  • v5.1.0(Feb 24, 2020)

  • v5.0.0(Jun 27, 2017)

    Changelog:

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Aug 28, 2014)

Owner
Firebase
Firebase
Security Defense for Firebase's PHP-JWT Library

PHP-JWT-Guard Protect your code from being impacted by issue 351 in firebase/php-jwt. Installation First, install this library with Composer: composer

Paragon Initiative Enterprises 8 Nov 27, 2022
Simple JWT Auth support for Laravel PHP Framework

Laravel JWT Simple JWT Auth for Laravel PHP Framework using Firebase JWT under the hood. Installation Standard Composer package installation: composer

Ricardo Čerljenko 34 Nov 21, 2022
A PHP boilerplate based on Slim Framework, for start projects with Eloquent ORM, Validation, Auth (JWT), Repositories and Transformers ready

A PHP boilerplate based on Slim Framework, for start projects with Eloquent ORM, Validation, Auth (JWT), Repositories and Transformers ready.

Damiano Petrungaro 58 Aug 10, 2022
JWT auth for Laravel and Lumen

JWT Artisan Token auth for Laravel and Lumen web artisans JWT is a great solution for authenticating API requests between various services. This packa

⑅ Generation Tux ⑅ 141 Dec 21, 2022
Laravel Auth guard for FusionAuth JWT

Laravel FusionAuth JWT Implement an Auth guard for FusionAuth JWTs in Laravel. It ships with also a middleware to check against the user role. Install

Theraloss 7 Feb 21, 2022
Probando JWT en Laravel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

SelsiusRC28 1 Nov 2, 2021
Rest API - JWT - Symfony5

Symfony5 JWT - REST API Example Symfony5 JWT - REST API Example Built With PHP Symfony 5 PostgreSQL Getting Started This is an example of how you may

Salih Gencer 1 Dec 24, 2021
PSR-7 and PSR-15 JWT Authentication Middleware

PSR-7 and PSR-15 JWT Authentication Middleware This middleware implements JSON Web Token Authentication. It was originally developed for Slim but can

Mika Tuupola 782 Dec 18, 2022
Laravel JWT-Authentication API starter kit for rapid backend prototyping.

Laravel JWT API A Laravel JWT API starter kit. Features Laravel 8 Login, register, email verification and password reset Authentication with JWT Socia

Oybek Odilov 3 Nov 6, 2022
JSON Web Token (JWT) for webman plugin

JSON Web Token (JWT) for webman plugin Json web token (JWT), 是为了在网络应用环境间传递声明而执行的一种基于JSON的开放标准((RFC 7519).该token被设计为紧凑且安全的,特别适用于分布式站点的单点登录(SSO)场景。

 ShaoBo Wan(無尘) 25 Dec 30, 2022
Sistema de Administrativo - Cliente e Vendedor - Autenticação JWT e Relacionamentos BD

Hi there, My name is ATTILA SAMUELL TABORY, I love technology ?? Sistema Administrativo Laravel e Vue JS - JWT e Relacionamentos BD Sistema Administra

Attila Samuell 7 May 9, 2022
Aplicação criada com Slim Framework com objetivo de criar autenticação com JWT e aprender sobre o framework Slim

Slim JWT App Essa aplicação tem como foco o aprendizado do Framework Slim e também a utilização de JWT. Como rodar a Aplicação A aplicação está config

Nicolas Pereira 9 Oct 4, 2022
JWT Authenticator for symfony

HalloVerdenJwtAuthenticatorBundle This bundle provides a JWT authenticator for Symfony applications. It's using PHP JWT Framework for parsing and vali

Hallo Verden 0 Jul 8, 2022
A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package

laravel-social A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package. I

Sergi Tur Badenas 42 Nov 29, 2022
A flexible, driver based Acl package for PHP 5.4+

Lock - Acl for PHP 5.4+ I'm sad to say that Lock is currently not maintained. I won't be able to offer support or accept new contributions for the cur

Beatswitch 892 Dec 30, 2022
PHP package built for Laravel 5.* to easily handle a user email verification and validate the email

jrean/laravel-user-verification is a PHP package built for Laravel 5.* & 6.* & 7.* & 8.* to easily handle a user verification and validate the e-mail.

Jean Ragouin 802 Dec 29, 2022
An invisible reCAPTCHA package for Laravel, Lumen, CI or native PHP.

Invisible reCAPTCHA Why Invisible reCAPTCHA? Invisible reCAPTCHA is an improved version of reCAPTCHA v2(no captcha). In reCAPTCHA v2, users need to cl

Albert Chen 578 Nov 30, 2022
A One Time Password Authentication package, compatible with Google Authenticator.

Google2FA Google Two-Factor Authentication for PHP Google2FA is a PHP implementation of the Google Two-Factor Authentication Module, supporting the HM

Antonio Carlos Ribeiro 1.6k Dec 30, 2022
via this package you can push notifications to [ Facebook , Twitter , Telegram , Linkedin ] ( Laravel )

Push To Social [ Facebook , Twitter , Telegram , Linkedin ] via this package you can push notifications to [ Facebook , Twitter , Telegram , Linkedin

Peter Tharwat 29 Nov 4, 2022