Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. XOAuth2Authenticator.php

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\Auth
View 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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal