Class CtctOAuth2
Class that implements necessary functionality to obtain an access token from
a user
Methods summary
public
|
#
__construct( mixed $clientId, mixed $clientSecret, mixed $redirectUri, mixed $restClient = null )
|
public
string
|
#
getAuthorizationUrl( boolean $server = true, string $state = null )
Get the URL at which the user can authenticate and authorize the requesting
application
Get the URL at which the user can authenticate and authorize the requesting
application
Parameters
- $server
boolean $server - Whether or not to use OAuth2 server flow, alternative is client flow
- $state
string $state - An optional value used by the client to maintain state between the
request and callback.
Returns
string $url - The url to send a user to, to grant access to their account
|
public
array
|
#
getAccessToken( string $code )
Obtain an access token
Parameters
- $code
string $code - code returned from Constant Contact after a user has granted access to
their account
Returns
array
Throws
Ctct\Exception\OAuth2Exception
|
public
array
|
#
getTokenInfo( string $accessToken )
Get an information about an access token
Get an information about an access token
Parameters
- $accessToken
string $accessToken - Constant Contact OAuth2 access token
Returns
array
Throws
Ctct\Exception\CtctException
|