ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
PHPMailerOAuthGoogle Class Reference
+ Collaboration diagram for PHPMailerOAuthGoogle:

Public Member Functions

 __construct ( $UserEmail, $ClientSecret, $ClientId, $RefreshToken)
 
 getOauth64 ()
 

Private Member Functions

 getProvider ()
 
 getGrant ()
 
 getToken ()
 

Private Attributes

 $oauthUserEmail = ''
 
 $oauthRefreshToken = ''
 
 $oauthClientId = ''
 
 $oauthClientSecret = ''
 

Detailed Description

Definition at line 27 of file class.phpmaileroauthgoogle.php.

Constructor & Destructor Documentation

◆ __construct()

PHPMailerOAuthGoogle::__construct (   $UserEmail,
  $ClientSecret,
  $ClientId,
  $RefreshToken 
)
Parameters
string$UserEmail
string$ClientSecret
string$ClientId
string$RefreshToken

Definition at line 40 of file class.phpmaileroauthgoogle.php.

45  {
46  $this->oauthClientId = $ClientId;
47  $this->oauthClientSecret = $ClientSecret;
48  $this->oauthRefreshToken = $RefreshToken;
49  $this->oauthUserEmail = $UserEmail;
50  }

Member Function Documentation

◆ getGrant()

PHPMailerOAuthGoogle::getGrant ( )
private

Definition at line 60 of file class.phpmaileroauthgoogle.php.

Referenced by getToken().

61  {
62  return new \League\OAuth2\Client\Grant\RefreshToken();
63  }
+ Here is the caller graph for this function:

◆ getOauth64()

PHPMailerOAuthGoogle::getOauth64 ( )

Definition at line 72 of file class.phpmaileroauthgoogle.php.

References getToken().

73  {
74  $token = $this->getToken();
75  return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001");
76  }
+ Here is the call graph for this function:

◆ getProvider()

PHPMailerOAuthGoogle::getProvider ( )
private

Definition at line 52 of file class.phpmaileroauthgoogle.php.

Referenced by getToken().

53  {
55  'clientId' => $this->oauthClientId,
56  'clientSecret' => $this->oauthClientSecret
57  ]);
58  }
+ Here is the caller graph for this function:

◆ getToken()

PHPMailerOAuthGoogle::getToken ( )
private

Definition at line 65 of file class.phpmaileroauthgoogle.php.

References League\OAuth2\Client\Provider\$provider, getGrant(), and getProvider().

Referenced by getOauth64().

66  {
67  $provider = $this->getProvider();
68  $grant = $this->getGrant();
69  return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]);
70  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $oauthClientId

PHPMailerOAuthGoogle::$oauthClientId = ''
private

Definition at line 31 of file class.phpmaileroauthgoogle.php.

◆ $oauthClientSecret

PHPMailerOAuthGoogle::$oauthClientSecret = ''
private

Definition at line 32 of file class.phpmaileroauthgoogle.php.

◆ $oauthRefreshToken

PHPMailerOAuthGoogle::$oauthRefreshToken = ''
private

Definition at line 30 of file class.phpmaileroauthgoogle.php.

◆ $oauthUserEmail

PHPMailerOAuthGoogle::$oauthUserEmail = ''
private

Definition at line 29 of file class.phpmaileroauthgoogle.php.


The documentation for this class was generated from the following file: