From 941b7eb3ef040a9493b183ca7d47b8c8408ae3b8 Mon Sep 17 00:00:00 2001 From: ppom <> Date: Wed, 21 Feb 2024 12:00:00 +0100 Subject: [PATCH] Fix missing trailing slashes The POST on /api/v1/oauth/token won't work, returning an HTTP 405. Adding a / at the end fixes the issue. --- docs/developer/api/authentication.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/developer/api/authentication.md b/docs/developer/api/authentication.md index 0629ad4d5..56aa8337a 100644 --- a/docs/developer/api/authentication.md +++ b/docs/developer/api/authentication.md @@ -81,7 +81,7 @@ Funkwhale supports the `urn:ietf:wg:oauth:2.0:oob` redirect URI for non-web appl Once you've decided on your scopes and your redirect URI, you can create your app using one of the following methods: 1. Visit `/settings/applications/new` on your Funkwhale pod while logged in -2. Send a `POST` request to `/api/v1/oauth/apps`. See our [API documentation](https://docs.funkwhale.audio/swagger/) for more information +2. Send a `POST` request to `/api/v1/oauth/apps`. See our [API documentation](https://docs.funkwhale.audio/swagger/#/oauth/create_oauth_app) for more information Both methods return a [**client ID**](https://www.rfc-editor.org/rfc/rfc6749#section-2.2) and a [**secret**](https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1). @@ -95,7 +95,7 @@ You need an [**authorization code**](https://www.rfc-editor.org/rfc/rfc6749#sect To fetch an authorization code, you need to send the user to their Funkwhale pod to authenticate. This sends an [authorization request](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.2) to the server. -To do this, call the `/authorize` endpoint with the following URL encoded query parameters: +To do this, call the `/authorize` (no trailing `/`) endpoint with the following URL encoded query parameters: - `client_id`\* - Your application's client ID - `response_type`\* - Must be set to `code`. @@ -109,7 +109,7 @@ When the user authorizes your app, the server responds with an authorization cod ## 3. Get an access token -Once you receive your authorization code, you need to [request an access token](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3). To request an access token, call the `/api/v1/oauth/token` endpoint with the following information: +Once you receive your authorization code, you need to [request an access token](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3). To request an access token, call the `/api/v1/oauth/token/` (trailing `/` required) endpoint with the following information: - `grant_type`\* - Must be set to `authorization_code` - `code`\* - Your application's authorization code @@ -128,7 +128,7 @@ When you refresh your token the endpoint returns a new `refresh_token`. You must By default, Funkwhale access tokens are valid for **10 hours**. Pod admins can configure this by setting the `ACCESS_TOKEN_EXPIRE_SECONDS` variable in their `.env` file. -After the access token expires, you must request a new access token by calling the `/api/v1/oauth/token` endpoint with the following information: +After the access token expires, you must request a new access token by calling the `/api/v1/oauth/token/` (trailing `/` required) endpoint with the following information: - `grant_type`\* - Must be set to `refresh_token` - `refresh_token`\* - Your current refresh token