OAuth
in package
OAuth - OAuth2 authentication wrapper class.
Uses the oauth2-client package from the League of Extraordinary Packages.
Tags
Table of Contents
- $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.
- __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
= null
$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
= null
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
andrefreshToken
elements
Return values
mixed —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