PHPMailer

OAuth
in package
implements OAuthTokenProvider

OAuth - OAuth2 authentication wrapper class.

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

Tags
see
https://oauth2-client.thephpleague.com
author

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

Table of Contents

Interfaces

OAuthTokenProvider
OAuthTokenProvider - OAuth2 token provider interface.

Properties

$oauthClientId  : string
The client ID, generated in the app definition of the service you're connecting to.
$oauthClientSecret  : string
The client secret, generated in the app definition of the service you're connecting to.
$oauthRefreshToken  : string
The refresh token, used to obtain new AccessTokens.
$oauthToken  : AccessToken
The current OAuth access token.
$oauthUserEmail  : string
The user's email address, usually used as the login ID and also the from address when sending email.
$provider  : AbstractProvider
An instance of the League OAuth Client Provider.

Methods

__construct()  : mixed
OAuth constructor.
getOauth64()  : string
Generate a base64-encoded OAuth token.
getGrant()  : RefreshToken
Get a new RefreshToken.
getToken()  : AccessToken
Get a new AccessToken.

Properties

$oauthClientId

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

protected string $oauthClientId = ''

$oauthClientSecret

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

protected string $oauthClientSecret = ''

$oauthRefreshToken

The refresh token, used to obtain new AccessTokens.

protected string $oauthRefreshToken = ''

$oauthToken

The current OAuth access token.

protected AccessToken $oauthToken

$oauthUserEmail

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

protected string $oauthUserEmail = ''

$provider

An instance of the League OAuth Client Provider.

protected AbstractProvider $provider

Methods

__construct()

OAuth constructor.

public __construct(array<string|int, mixed> $options) : mixed
Parameters
$options : array<string|int, mixed>

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

getOauth64()

Generate a base64-encoded OAuth token.

public getOauth64() : string
Return values
string

getGrant()

Get a new RefreshToken.

protected getGrant() : RefreshToken
Return values
RefreshToken

getToken()

Get a new AccessToken.

protected getToken() : AccessToken
Return values
AccessToken

        
On this page

Search results