Class JwtAuthenticate
An authentication adapter for authenticating using JSON Web Tokens.
$this->Auth->config('authenticate', [ 'BEdita/Auth.Jwt' => [ 'parameter' => 'token', 'userModel' => 'Users', 'fields' => [ 'username' => 'id', ], ], ]);
- Cake\Auth\BaseAuthenticate
-
BEdita\API\Auth\JwtAuthenticate
Namespace: BEdita\API\Auth
See: http://jwt.io
See: http://tools.ietf.org/html/draft-ietf-oauth-json-web-token
Since: 4.0.0
Located at API/src/Auth/JwtAuthenticate.php
See: http://jwt.io
See: http://tools.ietf.org/html/draft-ietf-oauth-json-web-token
Since: 4.0.0
Located at API/src/Auth/JwtAuthenticate.php
Methods summary
public
array|false
|
#
authenticate( Cake\Http\ServerRequest $request, Cake\Http\Response $response )
Get user record based on info available in JWT. |
public
array|false
|
|
public
object|false
|
|
public
string|null
|
|
protected
array|false
|
|
public
|
#
unauthenticated( Cake\Http\ServerRequest $request, Cake\Http\Response $response )
Handles an unauthenticated access attempt. |
Properties summary
protected
array
|
$_defaultConfig
Default config for this object. |
#
[
'header' => 'Authorization',
'headerPrefix' => 'Bearer',
'queryParam' => 'token',
'allowedAlgorithms' => [
'HS256',
'HS512',
],
'fields' => [
'username' => 'id',
'password' => null,
],
'userModel' => 'Users',
'scope' => [],
'finder' => 'login',
'contain' => null,
'passwordHasher' => 'Default',
'queryDatasource' => false,
]
|
protected
string|null
|
$token
Parsed token. |
#
null
|
protected
object|null
|
$payload
Payload data. |
#
null
|
protected
Exception
|
$error
Exception. |