Thruway\Peer\Client::processChallenge PHP Method

processChallenge() public method

Handle process challenge message
public processChallenge ( ClientSession $session, Thruway\Message\ChallengeMessage $msg )
$session Thruway\ClientSession
$msg Thruway\Message\ChallengeMessage
    public function processChallenge(ClientSession $session, ChallengeMessage $msg)
    {
        $authMethod = $msg->getAuthMethod();
        // look for authenticator
        /** @var ClientAuthenticationInterface $ca */
        foreach ($this->clientAuthenticators as $ca) {
            if (in_array($authMethod, $ca->getAuthMethods())) {
                $authenticateMsg = $ca->getAuthenticateFromChallenge($msg);
                $session->sendMessage($authenticateMsg);
                return;
            }
        }
        $this->emit('challenge', [$session, $msg]);
    }