mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-71119 core_badges: Use basicauth and remove urlencode
Basic authorization header is required to get token. Besides, client id and secret shouldn't call urlencode.
This commit is contained in:
parent
c974a59f41
commit
c1649591a2
@ -222,6 +222,7 @@ class client extends \core\oauth2\client {
|
||||
$callbackurl = self::callback_url();
|
||||
|
||||
if ($granttype == 'authorization_code') {
|
||||
$this->basicauth = true;
|
||||
$params = array('code' => $code,
|
||||
'grant_type' => $granttype,
|
||||
'redirect_uri' => $callbackurl->out(false),
|
||||
@ -236,7 +237,7 @@ class client extends \core\oauth2\client {
|
||||
);
|
||||
}
|
||||
if ($this->basicauth) {
|
||||
$idsecret = urlencode($this->clientid) . ':' . urlencode($this->clientsecret);
|
||||
$idsecret = $this->clientid . ':' . $this->clientsecret;
|
||||
$this->setHeader('Authorization: Basic ' . base64_encode($idsecret));
|
||||
} else {
|
||||
$params['client_id'] = $this->clientid;
|
||||
|
Loading…
x
Reference in New Issue
Block a user