class OAuth2Client (View source)

Constants

BASE_URL

The Base URL

AUTH_TOKEN_URL

Auth Token URL

Properties

protected DropboxApp $app The Dropbox App
protected DropboxClient $client The Dropbox Client

Methods

__construct(DropboxApp $app, DropboxClient $client, RandomStringGeneratorInterface $randStrGenerator = null)

Create a new DropboxApp instance

string
buildUrl(string $endpoint = '', array $params = array())

Build URL

getApp()

Get the Dropbox App

getClient()

Get the Dropbox Client

string
getAuthorizationUrl(string $redirectUri, string $state = null, array $params = array())

Get the OAuth2 Authorization URL

array
getAccessToken(string $code, string $redirectUri = null, string $grant_type = 'authorization_code')

Get Access Token

void
revokeAccessToken()

Disables the access token

Details

at line line 47
__construct(DropboxApp $app, DropboxClient $client, RandomStringGeneratorInterface $randStrGenerator = null)

Create a new DropboxApp instance

Parameters

DropboxApp $app
DropboxClient $client
RandomStringGeneratorInterface $randStrGenerator

at line line 62
protected string buildUrl(string $endpoint = '', array $params = array())

Build URL

Parameters

string $endpoint
array $params Query Params

Return Value

string

at line line 73
DropboxApp getApp()

Get the Dropbox App

Return Value

DropboxApp

at line line 83
DropboxClient getClient()

Get the Dropbox Client

Return Value

DropboxClient

at line line 99
string getAuthorizationUrl(string $redirectUri, string $state = null, array $params = array())

Get the OAuth2 Authorization URL

Parameters

string $redirectUri Callback URL to redirect user after authorization
string $state CSRF Token
array $params Additional Params

Return Value

string

at line line 121
array getAccessToken(string $code, string $redirectUri = null, string $grant_type = 'authorization_code')

Get Access Token

Parameters

string $code Authorization Code
string $redirectUri Redirect URI used while getAuthorizationUrl
string $grant_type Grant Type ['authorization_code']

Return Value

array

at line line 159
void revokeAccessToken()

Disables the access token

Return Value

void