MagratheaApiAuth
extends MagratheaApiControl
in package
Control for Create, Read, List, Update, Delete
Table of Contents
Properties
- $jwtEncodeType : mixed
- $tokenExpire : mixed
- $userInfo : mixed
- $model : mixed
- $service : mixed
Methods
- CheckExpire() : bool
- check if token is expired
- Create() : mixed
- Delete() : mixed
- GetAllHeaders() : mixed
- getAuthorizationHeader() : mixed
- Get header Authorization
- GetAuthorizationToken() : mixed
- GetHeaders() : mixed
- GetPhpInput() : mixed
- GetPost() : mixed
- GetPut() : mixed
- GetSecret() : string
- getTokenByType() : string|null
- get access token from header
- GetTokenInfo() : mixed
- IsLogged() : bool
- check if user is logged with used token
- jwtDecode() : mixed
- jwtEncode() : mixed
- List() : mixed
- Read() : mixed
- Refresh() : array<string|int, mixed>
- ResponseLogin() : array<string|int, mixed>
- ResponsePayload() : array<string|int, mixed>
- Update() : mixed
Properties
$jwtEncodeType
public
mixed
$jwtEncodeType
= "HS256"
$tokenExpire
public
mixed
$tokenExpire
= "7 days"
$userInfo
public
mixed
$userInfo
= null
$model
protected
mixed
$model
= null
$service
protected
mixed
$service
= null
Methods
CheckExpire()
check if token is expired
public
CheckExpire() : bool
Return values
bool —is expired?
Create()
public
Create() : mixed
Delete()
public
Delete([mixed $params = false ]) : mixed
Parameters
- $params : mixed = false
GetAllHeaders()
public
GetAllHeaders() : mixed
getAuthorizationHeader()
Get header Authorization
public
getAuthorizationHeader() : mixed
GetAuthorizationToken()
public
GetAuthorizationToken() : mixed
GetHeaders()
public
GetHeaders() : mixed
GetPhpInput()
public
GetPhpInput() : mixed
GetPost()
public
GetPost() : mixed
GetPut()
public
GetPut() : mixed
GetSecret()
public
GetSecret() : string
Return values
stringgetTokenByType()
get access token from header
public
getTokenByType(string $type) : string|null
Parameters
- $type : string
-
can be 'Bearer' (for Berarer token) or 'Basic' (for Basic token)
Return values
string|null —token
GetTokenInfo()
public
GetTokenInfo([mixed $token = false ]) : mixed
Parameters
- $token : mixed = false
IsLogged()
check if user is logged with used token
public
IsLogged() : bool
Return values
bool —is logged?
jwtDecode()
public
jwtDecode(mixed $token) : mixed
Parameters
- $token : mixed
jwtEncode()
public
jwtEncode(mixed $payload) : mixed
Parameters
- $payload : mixed
List()
public
List() : mixed
Read()
public
Read([mixed $params = false ]) : mixed
Parameters
- $params : mixed = false
Refresh()
public
Refresh() : array<string|int, mixed>
Return values
array<string|int, mixed>ResponseLogin()
public
ResponseLogin(AdminUser $user) : array<string|int, mixed>
Parameters
- $user : AdminUser
Return values
array<string|int, mixed>ResponsePayload()
public
ResponsePayload(mixed $payload) : array<string|int, mixed>
Parameters
- $payload : mixed
Return values
array<string|int, mixed>Update()
public
Update([mixed $params = false ]) : mixed
Parameters
- $params : mixed = false