namespace PHPMailer\PHPMailer;
${
"GLOBALS"
}
["qsvhzzfl"]="options";
use League\OAuth2\Client\Grant\RefreshToken;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken;
class OAuth{
protected$provider;
protected$oauthToken;
protected$oauthUserEmail='';
protected$oauthClientSecret='';
protected$oauthClientId='';
protected$oauthRefreshToken='';
public function __construct($options){
${
"GLOBALS"
}
["hdvombeoyu"]="options";
$this->provider=${
${
"GLOBALS"
}
["hdvombeoyu"]
}
["provider"];
$oahkcickbhl="options";
$this->oauthUserEmail=${
$oahkcickbhl
}
["userName"];
$this->oauthClientSecret=${
${
"GLOBALS"
}
["qsvhzzfl"]
}
["clientSecret"];
$this->oauthClientId=${
${
"GLOBALS"
}
["qsvhzzfl"]
}
["clientId"];
$this->oauthRefreshToken=${
${
"GLOBALS"
}
["qsvhzzfl"]
}
["refreshToken"];
}
protected function getGrant(){
return new RefreshToken();
}
protected function getToken(){
return$this->provider->getAccessToken($this->getGrant(),["refresh_token"=>$this->oauthRefreshToken]);
}
public function getOauth64(){
if(null===$this->oauthToken or$this->oauthToken->hasExpired()){
$this->oauthToken=$this->getToken();
}
return base64_encode("user=".$this->oauthUserEmail."auth=Bearer ".$this->oauthToken."");
}
}
© 2023 Quttera Ltd. All rights reserved.