---
title: "Authentication"
method: POST
path: "/auth"
tags: ["Authentication"]
---

# Authentication

`POST /auth`

## Request

- Base URL: `https://api.folksonomy.openfoodfacts.org`
- URL: `https://api.folksonomy.openfoodfacts.org/auth`
- Auth: none declared

Authentication: provide user/password and get a bearer token in return

- **username**: Open Food Facts user_id (not email)
- **password**: user password (clear text, but HTTPS encrypted)

token is returned, to be used in later requests with usual "Authorization: bearer token" headers

## Request body `application/x-www-form-urlencoded`

- BodyAuthenticationAuthPost
  - `grant_type` string, nullable
  - `username` string, required
  - `password` string, required
  - `scope` string
  - `client_id` string, nullable
  - `client_secret` string, nullable

## Response `200`

Successful Response

- TokenResponse
  - `access_token` string, required
  - `token_type` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/openfoodfacts/apis/open-food-facts-folksonomy-rest-api.md) - [All operations](https://skmtc.dev/openfoodfacts/apis/open-food-facts-folksonomy-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openfoodfacts/apis/open-food-facts-folksonomy-rest-api/revisions/ecf11a0df87a?raw)
