When using a stateless authentication type (Basic or Digest), how can you access the user who was authenticated for the request?
With normal form authentication this is done with $this->Auth->user()
, however when using Basic Authentication this always returns null
, even when authentication was successful.
Good hint from @ndm, I was calling $this->Auth->user()
to soon: I am loading the Auth component in AppController->initialize()
, but apparently the user info is only available afterwards.