DigestAuthenticate (class)
Class DigestAuthenticate
Digest Authentication adapter for AuthComponent.
Provides Digest HTTP authentication support for AuthComponent.
Using Digest auth
In your controller's components array, add auth + the required config
public $components = [ 'Auth' => [ 'authenticate' => ['Digest'] ] ];
You should also set AuthComponent::$sessionKey = false;
in your AppController's beforeFilter() to prevent CakePHP from sending a session cookie to the client.
Since HTTP Digest Authentication is stateless you don't need a login() action 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.
You may also want to use $this->Auth->unauthorizedRedirect = false;登录查看完整内容