(REF) authx - Reorganize internal methods to use an auth-request object
authorTim Otten <totten@civicrm.org>
Fri, 26 Feb 2021 04:18:42 +0000 (20:18 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 2 Mar 2021 19:37:53 +0000 (11:37 -0800)
commit0ecb5a5f13df00e73b6b249b5c34ddf2ecfd8489
tree224d455178669d11903bcfcd5abcd50d3026a182
parent8a01c43886a525eaa88977989f1a929d2564b9ed
(REF) authx - Reorganize internal methods to use an auth-request object

This significantly trims down the `auth()` method and rearranges as three
methods. A data object is passed between the three methods. The main method:

```
    if ($principal = $this->checkCredential($tgt)) {
      $tgt->setPrincipal($principal);
    }
    $this->checkPolicy($tgt);
    $this->login($tgt);
```

This arrangement lays the groundwork for implementing more varied policies.
For example, we could have a policy where the ability to login via
username/password/api_key is dictated by the user's role or permissions.
ext/authx/Civi/Authx/Authenticator.php
ext/authx/authx.php