PHP Interface GenTux\Jwt\Drivers\JwtDriverInterface

Mostra file Open project: generationtux/jwt-artisan Interface Usage Examples

Public Methods

Method Description
createToken ( array $payload, string $secret, string $algorithm = 'HS256' ) : string Create a new token with the provided payload
decodeToken ( string $token, string $secret, string $algorithm = 'HS256' ) : array Decode the provided token into an array
validateToken ( string $token, string $secret, string $algorithm = 'HS256' ) : boolean Validate that the provided token

Method Details

createToken() public method

Create a new token with the provided payload
public createToken ( array $payload, string $secret, string $algorithm = 'HS256' ) : string
$payload array
$secret string
$algorithm string
return string

decodeToken() public method

Decode the provided token into an array
public decodeToken ( string $token, string $secret, string $algorithm = 'HS256' ) : array
$token string
$secret string
$algorithm string
return array

validateToken() public method

Validate that the provided token
public validateToken ( string $token, string $secret, string $algorithm = 'HS256' ) : boolean
$token string
$secret string
$algorithm string
return boolean