cakephp/cakephp — pull request #3654 by lorenzo (2014-06-05 20:28:51+00:00)
Title: 3.0 auth improvements

This solves 2 problems:

* I often needed to know which authentication or authorization provider was used in the current request. I alway had to hack that by adding setting some global state form the providers. This patch adds a couple methods that will return the instance of the auth providers that were successfully used.
* Now it is possible to rehash password by asking the relevant auth provider to do it for you. It will not save to database, though. Users are still responsible for persisting the freshly hashed password

### Example:

```php
if ($this->Auth->login()) {
$provider = $this->Auth->loginProvider();
$rehashed = $provider->needsPasswordRehash() ? $provider->rehashPassword() : null;
if ($rehashed) {
$this->Users->save(...)
}
}
```