AuthToken.php
public static function verify($token, $key)
    {
        // Check values
        if (empty($token) || empty($key)) {
            return false;
        }

        // Split parts
        list($payloadJSON_encoded, $signature) = explode('.', $token);

        // Generate signature to verify
        $signatureGenerated = hash_hmac('SHA256', $payloadJSON_encoded, $key);

        return ($signature === $signatureGenerated);
    }
public static function verify($token, $key)
    {
        // Check values
        if (empty($token) || empty($key)) {
            return false;
        }

        // Split parts
        list($payloadJSON_encoded, $signature) = explode('.', $token);

        // Generate signature to verify
        $signatureGenerated = hash_hmac('SHA256', $payloadJSON_encoded, $key);

        return ($signature === $signatureGenerated);
    }
public static function verify ( $ token , $ key ) { // Check values if ( empty ( $ token ) || empty ( $ key ) ) { return false ; } // Split parts list ( $ payloadJSON_encoded , $ signature ) = explode ( '.' , $ token ) ; // Generate signature to verify $ signatureGenerated = hash_hmac ( 'SHA256' , $ payloadJSON_encoded , $ key ) ; return ( $ signature === $ signatureGenerated ) ; }
Verify the given token with the given signature key.

@param string $token The authentication token.
@param string $key   The signature secret key.

@return boolean True if valid, false otherwise.
Verify the given token with the given signature key .