aboutsummaryrefslogtreecommitdiffstats
path: root/apps/oauth2/lib/Controller/OauthApiController.php
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-02-27 16:47:46 +0100
committerjld3103 <jld3103yt@gmail.com>2023-07-12 07:32:30 +0200
commit1c19c567fed25f3041396df729b41e7e6dda60b0 (patch)
tree5ab7b3156c2c0f9814ccca6e2ed0642dbf506a8b /apps/oauth2/lib/Controller/OauthApiController.php
parent2cf8d6d9652a55f81c6800f2e69b71597736c56c (diff)
downloadnextcloud-server-1c19c567fed25f3041396df729b41e7e6dda60b0.tar.gz
nextcloud-server-1c19c567fed25f3041396df729b41e7e6dda60b0.zip
oauth2: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'apps/oauth2/lib/Controller/OauthApiController.php')
-rw-r--r--apps/oauth2/lib/Controller/OauthApiController.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php
index e07a2c2de15..8cdd8132441 100644
--- a/apps/oauth2/lib/Controller/OauthApiController.php
+++ b/apps/oauth2/lib/Controller/OauthApiController.php
@@ -8,6 +8,7 @@ declare(strict_types=1);
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Roeland Jago Douma <roeland@famdouma.nl>
+ * @author Kate Döen <kate.doeen@nextcloud.com>
*
* @license GNU AGPL version 3 or any later version
*
@@ -66,12 +67,17 @@ class OauthApiController extends Controller {
* @NoCSRFRequired
* @BruteForceProtection(action=oauth2GetToken)
*
- * @param string $grant_type
- * @param string $code
- * @param string $refresh_token
- * @param string $client_id
- * @param string $client_secret
- * @return JSONResponse
+ * Get a token
+ *
+ * @param string $grant_type Token type that should be granted
+ * @param string $code Code of the flow
+ * @param string $refresh_token Refresh token
+ * @param string $client_id Client ID
+ * @param string $client_secret Client secret
+ * @return JSONResponse<Http::STATUS_OK, array{access_token: string, token_type: string, expires_in: int, refresh_token: string, user_id: string}, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, array{error: string}, array{}>
+ *
+ * 200: Token returned
+ * 400: Getting token is not possible
*/
public function getToken($grant_type, $code, $refresh_token, $client_id, $client_secret): JSONResponse {