diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-29 16:13:43 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-29 16:17:54 +0300 |
commit | 3556e78c25036b1fbc55967771883e16732faacc (patch) | |
tree | 19136e65c8c6da7a5e177f8f81150af329e2385e /apps/oauth2/lib | |
parent | 645eaaa434d95c82fb97aded52dc7d81c94c45b0 (diff) |
The OAuth endpoint needs to support Basic Auth
* Add test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/oauth2/lib')
-rw-r--r-- | apps/oauth2/lib/Controller/OauthApiController.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php index 8c96a3feee1..2083741fa0c 100644 --- a/apps/oauth2/lib/Controller/OauthApiController.php +++ b/apps/oauth2/lib/Controller/OauthApiController.php @@ -118,6 +118,11 @@ class OauthApiController extends Controller { ], Http::STATUS_BAD_REQUEST); } + if (isset($this->request->server['PHP_AUTH_USER'])) { + $client_id = $this->request->server['PHP_AUTH_USER']; + $client_secret = $this->request->server['PHP_AUTH_PW']; + } + // The client id and secret must match. Else we don't provide an access token! if ($client->getClientIdentifier() !== $client_id || $client->getSecret() !== $client_secret) { return new JSONResponse([ |