yii\authclient\AuthAction::auth PHP Method

auth() protected method

Perform authentication for the given client.
protected auth ( mixed $client ) : Response
$client mixed auth client instance.
return yii\web\Response response instance.
    protected function auth($client)
    {
        if ($client instanceof OAuth2) {
            return $this->authOAuth2($client);
        } elseif ($client instanceof OAuth1) {
            return $this->authOAuth1($client);
        } elseif ($client instanceof OpenId) {
            return $this->authOpenId($client);
        }
        throw new NotSupportedException('Provider "' . get_class($client) . '" is not supported.');
    }

Usage Example

Beispiel #1
0
 /**
  * @inheritdoc
  * 
  * @param StandaloneAuthClient $client
  * @return response
  */
 public function auth($client)
 {
     if ($client instanceof StandaloneAuthClient) {
         return $client->authAction($this);
     }
     return parent::auth($client);
 }