Emite e renova tokens OAuth do MCP
POST/oauth/token
- Auth
- Token erforderlich
Die Beschreibungen der Endpoints stammen aus der API-Spezifikation und sind vorerst auf Portugiesisch. Die Oberfläche drumherum ist übersetzt.
`grant_type=authorization_code` troca o código pelo par de tokens, conferindo o PKCE (`code_verifier`) e a `redirect_uri`. `grant_type=refresh_token` renova e **gira** o refresh token: reapresentar um já usado revoga a conexão inteira. Access token de 1 hora, refresh de 30 dias, ambos opacos e presos à conexão (membro + comunidade). Aceita `application/x-www-form-urlencoded` ou JSON. Limite de 60 por minuto por IP. Público.
Request-Body application/x-www-form-urlencoded
| Name | Typ | Beschreibung |
|---|---|---|
grant_typePflicht | authorization_code | refresh_token | |
client_idPflicht | string | |
client_secretoptional | string | |
codeoptional | string | |
redirect_urioptional | string | |
code_verifieroptional | string | |
refresh_tokenoptional | string | |
resourceoptional | string |
Antworten
| Status | Beschreibung |
|---|---|
200 | `{ access_token, token_type: Bearer, expires_in, refresh_token, scope }`. |
400 | `{ error, error_description }` — `invalid_grant`, `invalid_request`, `unsupported_grant_type`. |
401 | `invalid_client`. |
curl-Beispiel
curl -X POST "https://api.memberfy.net/oauth/token" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"grant_type":"authorization_code","client_id":"string"}'