Authentication

Authentication

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

POST
/auth
session?Session
grant_type?Grant Type
usernameUsername
passwordPassword
scope?Scope
Default""
client_id?Client Id
client_secret?Client Secret

Response Body

curl -X POST "https://api.folksonomy.openfoodfacts.org/auth" \
  --cookie "session=string" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d 'username=string&password=string'
{
  "access_token": "string",
  "token_type": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}