Silverstripe Version: 4.5.2
Question: I am trying to create a custom login authenticator, but Security keeps failing when looking up the authenticators - line 268 of Security\Security.php
The following exception occurs:
[Emergency] Uncaught Error: Call to a member function supportedServices() on string
GET /Security/login?BackURL=%2Fadmin%2Fdashboard%2F
Line 268 in …/vendor/silverstripe/framework/src/Security/Security.php
which is the “$authenticator->supportedServices()” line below:
public function getApplicableAuthenticators($service = Authenticator::LOGIN)
{
$authenticators = $this->getAuthenticators();
/** @var Authenticator $authenticator */
foreach ($authenticators as $name => $authenticator) {
if (!($authenticator->supportedServices() & $service)) {
unset($authenticators[$name]);
}
}
I have configured the authenticator in my config yml file, and it registers ok, but $authenticator at this stage is just a string class name. If I look at the value of $authenticator, it is simply my class name, not an instance.
What am I missing?
nakhor