You are here

public function BackupMigrateDropboxAPI::get_authorize_url in Backup and Migrate Dropbox 7.3

Returns the (parameterized) authorize URL.

@link https://www.dropbox.com/developers/documentation/http/documentation#oaut... @link https://dropbox.tech/developers/pkce--what-and-why-

Parameters

string $code_verifier: The code verifier to use to construct the authorize url.

Return value

string The URL to direct the user to, to allow him to give this app permission to access (a app specific folder on) his Dropbox account.

File

./backup_migrate_dropbox.dropbox_api.inc, line 67

Class

BackupMigrateDropboxAPI
BackupMigrateDropboxAPI contains all the details about the Dropbox api, authorization calls, endpoints, uris, parameters, error handling, and split requests for large uploads/downloads

Code

public function get_authorize_url($code_verifier) {
  global $language;
  return url('https://www.dropbox.com/oauth2/authorize', [
    'external' => TRUE,
    'query' => [
      'client_id' => $this
        ->get_app_id(),
      'response_type' => 'code',
      'token_access_type' => 'offline',
      'code_challenge_method' => 'S256',
      'code_challenge' => $this
        ->get_code_challenge($code_verifier),
      'locale' => $language->language,
    ],
  ]);
}