AppserverIo\Appserver\ServletEngine\Security\DependencyInjection\DeploymentDescriptorParser::mapAuthenticator PHP Method

mapAuthenticator() public method

Returns the authenticator class name for the passed shortname.
public mapAuthenticator ( string $shortname ) : string
$shortname string The shortname of the requested authenticator class name
return string The requested authenticator class name
    public function mapAuthenticator($shortname)
    {
        // query whether or not we've manager configuration found
        /** @var \AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $managerNode */
        if ($managerNode = $this->getAuthenticationContext()->getManagerConfiguration()) {
            // initialize the authenticator configurations found in the manager configuration
            /** @var \AppserverIo\Appserver\Core\Api\Node\AuthenticatorNodeInterface $authenticatorNode */
            foreach ($managerNode->getAuthenticators() as $authenticatorNode) {
                // query whether or not the shortname matches
                if (strcasecmp($authenticatorNode->getName(), $shortname) === 0) {
                    return $authenticatorNode->getType();
                }
            }
        }
        // throw an exception if the can't find an matching authenticator class name
        throw new AuthenticationException(sprintf('Can\\t find authenticator configuration for %s', $shortname));
    }