mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-70268-310-2' of git://github.com/peterRd/moodle into MOODLE_310_STABLE
This commit is contained in:
commit
cd10e95fd9
1 changed files with 15 additions and 7 deletions
|
@ -511,14 +511,22 @@ abstract class oauth2_client extends curl {
|
||||||
public function get_login_url() {
|
public function get_login_url() {
|
||||||
|
|
||||||
$callbackurl = self::callback_url();
|
$callbackurl = self::callback_url();
|
||||||
|
$defaultparams = [
|
||||||
|
'client_id' => $this->clientid,
|
||||||
|
'response_type' => 'code',
|
||||||
|
'redirect_uri' => $callbackurl->out(false),
|
||||||
|
'state' => $this->returnurl->out_as_local_url(false),
|
||||||
|
|
||||||
|
];
|
||||||
|
if (!empty($this->scope)) {
|
||||||
|
// The scope should only be included if a value is set.
|
||||||
|
// If none provided, the server MUST process the request and provide an appropriate documented response.
|
||||||
|
// See spec https://tools.ietf.org/html/rfc6749#section-3.3
|
||||||
|
$defaultparams['scope'] = $this->scope;
|
||||||
|
}
|
||||||
|
|
||||||
$params = array_merge(
|
$params = array_merge(
|
||||||
[
|
$defaultparams,
|
||||||
'client_id' => $this->clientid,
|
|
||||||
'response_type' => 'code',
|
|
||||||
'redirect_uri' => $callbackurl->out(false),
|
|
||||||
'state' => $this->returnurl->out_as_local_url(false),
|
|
||||||
'scope' => $this->scope,
|
|
||||||
],
|
|
||||||
$this->get_additional_login_parameters()
|
$this->get_additional_login_parameters()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue