[ Index ]

PHP Cross Reference of DokuWiki




/inc/ -> JWT.php (summary)

(no description)

File Size: 184 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JWT:: (9 methods):

Class: JWT  - X-Ref

Minimal JWT implementation

__construct($user, $issued)   X-Ref
Create a new JWT object

Use validate() or create() to create a new instance

param: string $user
param: int $issued

getSecret()   X-Ref
Load the cookiesalt as secret

return: string

validate($token)   X-Ref
Create a new instance from a token

return: self
param: $token

fromUser($user)   X-Ref
Create a new instance from a user

Loads an existing token if available

return: self
param: $user

getToken()   X-Ref
Get the JWT token for this instance

return: string

save()   X-Ref
Save the token for the user

Resets the issued timestamp

getUser()   X-Ref
Get the user of this token

return: string

getIssued()   X-Ref
Get the issued timestamp of this token

return: int

getStorageFile($user)   X-Ref
Get the storage file for this token

Tokens are stored to be able to invalidate them

return: string
param: string $user The user the token is for