class XOAuth2Authenticator
Handles XOAUTH2 authentication.
@author xu.li<AthenaLightenedMyPath@gmail.com>
Hierarchy
- class \Symfony\Component\Mailer\Transport\Smtp\Auth\XOAuth2Authenticator implements \Symfony\Component\Mailer\Transport\Smtp\Auth\AuthenticatorInterface
Expanded class hierarchy of XOAuth2Authenticator
See also
https://developers.google.com/google-apps/gmail/xoauth2_protocol
File
-
vendor/
symfony/ mailer/ Transport/ Smtp/ Auth/ XOAuth2Authenticator.php, line 23
Namespace
Symfony\Component\Mailer\Transport\Smtp\AuthView source
class XOAuth2Authenticator implements AuthenticatorInterface {
public function getAuthKeyword() : string {
return 'XOAUTH2';
}
/**
* @see https://developers.google.com/google-apps/gmail/xoauth2_protocol#the_sasl_xoauth2_mechanism
*/
public function authenticate(EsmtpTransport $client) : void {
$client->executeCommand('AUTH XOAUTH2 ' . base64_encode('user=' . $client->getUsername() . "\x01auth=Bearer " . $client->getPassword() . "\x01\x01") . "\r\n", [
235,
]);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
XOAuth2Authenticator::authenticate | public | function | Overrides AuthenticatorInterface::authenticate | |
XOAuth2Authenticator::getAuthKeyword | public | function | Gets the name of the AUTH mechanism this Authenticator handles. | Overrides AuthenticatorInterface::getAuthKeyword |