Class UuidAuthenticate
Anonymously authenticate users by providing a UUID.
Users can authenticate to the server by providing an UUID in the request headers:
Authorization: UUID 485fc381-e790-47a3-9794-1337c0a8fe68
-
Cake\Auth\BaseAuthenticate
-
BEdita\API\Auth\UuidAuthenticate
Methods summary
protected
array|boolean
|
#
_findUser( string $username, null $password = null )
Find a user by UUID.
Parameters
- $username
- UUID.
- $password
- Password.
Returns
array|boolean
|
public
|
#
authenticate( Cake\Http\ServerRequest $request, Cake\Http\Response $response )
|
public
|
#
getUser( Cake\Http\ServerRequest $request )
|
public
false|string
|
#
getToken( Cake\Http\ServerRequest $request )
Obtain the token from request headers.
Obtain the token from request headers.
Parameters
Returns
false|string
|
public
|
#
unauthenticated( Cake\Http\ServerRequest $request, Cake\Http\Response $response )
|
Properties summary
protected
array
|
$_defaultConfig
Default config for this object.
Default config for this object.
authProviders The AuthProviders entities associated to this authentication component.
Array formatted with auth_providers.name as key, from AuthProvidersTable::findAuthenticate()
header The header where the token is stored. Defaults to 'Authorization' .
headerPrefix The prefix to the token in header. Defaults to 'UUID' .
fields The fields to use to identify a user by.
userModel The alias for users table, defaults to Users.
finder The finder method to use to fetch user record. Defaults to 'all'.
You can set finder name as string or an array where key is finder name and value
is an array passed to Table::find() options.
E.g. ['finderName' => ['some_finder_option' => 'some_value']]
passwordHasher Password hasher class. Can be a string specifying class name
or an array containing className key, any other keys will be passed as
config to the class. Defaults to 'Default'.
- Options
scope and contain have been deprecated since 3.1. Use custom
finder instead to modify the query to fetch user record.
|
#
[
'authProviders' => [],
'header' => 'Authorization',
'headerPrefix' => 'UUID',
'fields' => [
'username' => 'ExternalAuth.provider_username',
'password' => null,
],
'userModel' => 'Users',
'scope' => [],
'finder' => 'all',
'contain' => null,
'passwordHasher' => 'Default',
]
|