OAuth

Implements\PHPMailer\PHPMailer\OAuthTokenProvider

OAuth - OAuth2 authentication wrapper class.

Uses the oauth2-client package from the League of Extraordinary Packages.

see
author

Marcus Bointon (Synchro/coolbru) phpmailer@synchromedia.co.uk

package

Default

Methods

OAuth constructor.

__construct(array $options)

Arguments

$options

array

Associative array containing provider, userName, clientSecret, clientId and refreshToken elements

Get a new RefreshToken.

getGrant(): \League\OAuth2\Client\Grant\RefreshToken

Response

\League\OAuth2\Client\Grant\RefreshToken

Generate a base64-encoded OAuth token.

getOauth64(): string

The string to be base 64 encoded should be in the form: "user=\001auth=Bearer \001\001"

Response

string

Get a new AccessToken.

getToken(): \League\OAuth2\Client\Token\AccessToken

Response

\League\OAuth2\Client\Token\AccessToken

Properties

An instance of the League OAuth Client Provider.

provider :\League\OAuth2\Client\Provider\AbstractProvider
var

Type(s)

\League\OAuth2\Client\Provider\AbstractProvider

The current OAuth access token.

oauthToken :\League\OAuth2\Client\Token\AccessToken
var

Type(s)

\League\OAuth2\Client\Token\AccessToken

The user's email address, usually used as the login ID and also the from address when sending email.

oauthUserEmail :string
var

Type(s)

string

The client secret, generated in the app definition of the service you're connecting to.

oauthClientSecret :string
var

Type(s)

string

The client ID, generated in the app definition of the service you're connecting to.

oauthClientId :string
var

Type(s)

string

The refresh token, used to obtain new AccessTokens.

oauthRefreshToken :string
var

Type(s)

string