Class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator
Inheritance | Swift_Transport_Esmtp_Auth_XOAuth2Authenticator |
---|---|
Implements | Swift_Transport_Esmtp_Authenticator |
Handles XOAUTH2 authentication.
Example:
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 587, 'tls')
->setAuthMode('XOAUTH2')
->setUsername('YOUR_EMAIL_ADDRESS')
->setPassword('YOUR_ACCESS_TOKEN');
See also https://developers.google.com/google-apps/gmail/xoauth2_protocol.
Public Methods
Method | Description | Defined By |
---|---|---|
authenticate() | Try to authenticate the user with $email and $token. | Swift_Transport_Esmtp_Auth_XOAuth2Authenticator |
getAuthKeyword() | Get the name of the AUTH mechanism this Authenticator handles. | Swift_Transport_Esmtp_Auth_XOAuth2Authenticator |
Protected Methods
Method | Description | Defined By |
---|---|---|
constructXOAuth2Params() | Construct the auth parameter. | Swift_Transport_Esmtp_Auth_XOAuth2Authenticator |
Method Details
Try to authenticate the user with $email and $token.
public bool authenticate ( Swift_Transport_SmtpAgent $agent, $email, $token ) | ||
$agent | Swift_Transport_SmtpAgent | |
string | ||
$token | string |
Construct the auth parameter.
See also https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism.
protected void constructXOAuth2Params ( $email, $token ) | ||
$token |
Get the name of the AUTH mechanism this Authenticator handles.
public string getAuthKeyword ( ) |