POST /api/v1/auth
Changed onAuthentication: provide username/password or a keycloak access_token and get a bearer token in return.
-
username: Open Food Facts user_id (not email)
-
password: user password (clear text, but HTTPS encrypted)
-
access_token: keycloak access_token (clear text)
A token is returned. If the set_cookie parameter is set to 1, the token is also set as a cookie named "opsession" in the response.
To authenticate, you can either:
- use the Authorization header with the Bearer scheme, e.g.: "Authorization: bearer token"
- use the opsession cookie, e.g.: "Cookie: opsession=token"
Request
- Base URLhttps://prices.openfoodfacts.org (the document declares no server; this is the origin it was published from)
- URLhttps://prices.openfoodfacts.org/api/v1/auth
- Authnone declared
Query parameters
Set to 1 to also return the access token in an "opsession" cookie.
Request body application/x-www-form-urlencoded
Response
Changes
- info
added the new optional
queryrequest parameterset_cookie
- info
- info
added the new optional request property
(media type: application/x-www-form-urlencoded) - info
added the new optional request property
(media type: multipart/form-data) - info
request body became optional
- info
the request property
became optional (media type: application/x-www-form-urlencoded) - info
the request property
became optional (media type: multipart/form-data) - info
the request property
became optional (media type: application/x-www-form-urlencoded) - info
the request property
became optional (media type: multipart/form-data) - info
the request required property
became write-only (media type: application/x-www-form-urlencoded) - info
the request required property
became write-only (media type: multipart/form-data) - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- info