Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ class Client
* @var string
* The base URL for authorization requests.
*/
const AUTH_URL = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';
private $auth_url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';

/**
* @var string
* The base URL for token requests.
*/
const TOKEN_URL = 'https://login.microsoftonline.com/common/oauth2/v2.0/token';
private $token_url = 'https://login.microsoftonline.com/common/oauth2/v2.0/token';

/**
* @var string
Expand Down Expand Up @@ -216,7 +216,7 @@ public function getLogInUrl(array $scopes, $redirectUri, $state = null)
// redirected to the redirect URI, with a code passed in the query
// string (the name of the variable is "code"). This is suitable for
// PHP.
return self::AUTH_URL . "?$query";
return $this->auth_url . "?$query";
}

/**
Expand Down Expand Up @@ -305,7 +305,7 @@ public function obtainAccessToken($clientSecret, $code)
];

$response = $this->httpClient->post(
self::TOKEN_URL,
$this->token_url,
['form_params' => $values]
);

Expand Down Expand Up @@ -355,7 +355,7 @@ public function renewAccessToken($clientSecret)
];

$response = $this->httpClient->post(
self::TOKEN_URL,
$this->token_url,
['form_params' => $values]
);

Expand Down Expand Up @@ -885,4 +885,30 @@ public function getRecent()
);
}, $driveItems);
}

/**
* Sets the auth_url.
*
*
* @since 2.0.0
*
* @api
*/
public function setAuthUrl($url)
{
$this->auth_url = $url;
}

/**
* Sets the token_url.
*
*
* @since 2.0.0
*
* @api
*/
public function setTokenUrl($url)
{
$this->token_url = $url;
}
}