You should set storage to Memory to prevent CakePHP from sending a
session cookie to the client.
You should set unauthorizedRedirect to false. This causes AuthComponent to
throw a ForbiddenException exception instead of redirecting to another page.
Since HTTP Digest Authentication is stateless you don't need call setUser()
in your controller. The user credentials will be checked on each request. If
valid credentials are not provided, required authentication headers will be sent
by this authentication provider which triggers the login dialog in the browser/client.
Generating passwords compatible with Digest authentication.
DigestAuthenticate requires a special password hash that conforms to RFC2617.
You can generate this password using DigestAuthenticate::password()
If you wish to use digest authentication alongside other authentication methods,
it's recommended that you store the digest authentication separately. For
example User.digest_pass could be used for a digest password, while
User.password would store the password hash for use with other methods like
Basic or Form.
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.
Type
array
$_registry
$_registry : \Cake\Controller\ComponentRegistry
A Component registry, used to get more components.
Returns whether or not the password stored in the repository for the logged in user
requires to be rehashed with another algorithm
Returns
boolean
implementedEvents()
implementedEvents() : array
Returns a list of all events that this authenticate class will listen to.
An authenticate class can listen to following events fired by AuthComponent:
Auth.afterIdentify - Fired after a user has been identified using one of
configured authenticate class. The callback function should have signature
like afterIdentify(Event $event, array $user) when $user is the
identified user record.
Auth.logout - Fired when AuthComponent::logout() is called. The callback
function should have signature like logout(Event $event, array $user)
where $user is the user about to be logged out.
Returns
array
—
List of events this class listens to. Defaults to [].