[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/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):
  __construct()
  getSecret()
  validate()
  fromUser()
  getToken()
  save()
  getUser()
  getIssued()
  getStorageFile()


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

param: $token
return: self

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

Loads an existing token if available

param: $user
return: self

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

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