Skip to content

Latest commit

 

History

History
129 lines (93 loc) · 4.03 KB

File metadata and controls

129 lines (93 loc) · 4.03 KB

REST Authentication Service

Alpha License: LGPL-3 OCA/rest-framework Translate me on Weblate Try me on Runbot

This module adds API endpoints to deal with session authentication and logout.

Important

This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production. More details on development status

Table of contents

To authenticate you need to POST a request on [ODOO HOST]/session/auth/login with the following body:

{
    "db": [DB_NAME],
    "login": [LOGIN],
    "password": [PASSWORD]
}

"db" is not mandatory if Odoo is able to determine it unequivocally (e.g. single database server or dbfilter parameter). If the authentication is successful, the response will contain (in addition to the usual response of the JSON-RPC authentication):

{
    ...
    "session": {
        "sid": "ff6b4bac7a590e7960abfc0ac38361433ecac1d6",
        "expires_at": "2021-09-21 16:53:56"
    }
}

This sid value can then be sent in subsequent requests in the following ways:

  • header X-Openerp-Session-Id
  • cookie named session_id
  • request param session_id

To logout you need to POST a request on [ODOO HOST]/session/auth/logout with an empty body.

First official version.

Second version.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

  • Wakari

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/rest-framework project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.