Search 1.9 billion lines of Odoo code on GitHub

base_rest_auth_user_service

Author: Wakari, Odoo Community Association (OCA)
License: LGPL-3
Branch: 16.0
Repository: acsone/rest-framework
Dependencies: base_rest, and component
Languages: HTML (393, 66.7%), Python (97, 16.5%), and reStructuredText (99, 16.8%)
Other branches: 13.0-backport-base-rest-pydantic, 13.0-backport-extendable, 14.0, 14.0-add-pydantic, 14.0-base-rest-pydantic-lmi, 14.0-base_res_service_add_properties-qgr, 14.0-deprecated-implicit-rest-method, 14.0-fdl_master, 14.0-fix-path-parameter-name, 14.0-fix-response-processing, 14.0-moz_master, 15.0, 15.0-initial, 16.0-fastapi, 16.0-upgrade-pre-commit, and oca-port-pr--from-14.0-to-13.0
Other repositories: Change2improve/rest-framework, Digital5-Odoo/rest-framework, Gabinete-Digital/rest-framework, OCA/rest-framework, SeuMarco/rest-framework, akretion/rest-framework, coopiteasy/rest-framework, gastonfeng/rest-framework, gurneyalex/rest-framework, odoogap/rest-framework, simahawk/rest-framework, ursais/rest-framework, and wahello/rest-framework

<h1 class="title">REST Authentication Service</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/rest-framework/tree/15.0/base_rest_auth_user_service"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/rest-framework-15-0/rest-framework-15-0-base_rest_auth_user_service"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/271/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module adds API endpoints to deal with session authentication and logout.</p> <div class="admonition important"> <p class="first admonition-title">Important</p> <p class="last">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. <a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p> </div> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id3">Usage</a><ul> <li><a class="reference internal" href="#authentication" id="id4">Authentication</a></li> <li><a class="reference internal" href="#logout" id="id5">Logout</a></li> </ul> </li> <li><a class="reference internal" href="#changelog" id="id6">Changelog</a><ul> <li><a class="reference internal" href="#id1" id="id7">14.0.1.0.0</a></li> <li><a class="reference internal" href="#id2" id="id8">15.0.1.0.0</a></li> </ul> </li> <li><a class="reference internal" href="#bug-tracker" id="id9">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id10">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id11">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id12">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id13">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id3">Usage</a></h2> <a name="authentication"></a> <h3><a class="toc-backref" href="#id4">Authentication</a></h3> <p>To authenticate you need to <code class="code">POST</code> a request on <code class="code">[ODOO HOST]/session/auth/login</code> with the following body:</p> <pre> <code>{ &quot;db&quot;: [DB_NAME], &quot;login&quot;: [LOGIN], &quot;password&quot;: [PASSWORD] }</code> </pre> <p><code class="code">&quot;db&quot;</code> is not mandatory if Odoo is able to determine it unequivocally (e.g. single database server or <code class="code">dbfilter</code> parameter). If the authentication is successful, the response will contain (in addition to the usual response of the JSON-RPC authentication):</p> <pre> <code>{ ... &quot;session&quot;: { &quot;sid&quot;: &quot;ff6b4bac7a590e7960abfc0ac38361433ecac1d6&quot;, &quot;expires_at&quot;: &quot;2021-09-21 16:53:56&quot; } }</code> </pre> <p>This <code class="code">sid</code> value can then be sent in subsequent requests in the following ways:</p> <ul class="simple"> <li>header <code class="code">X-Openerp-Session-Id</code></li> <li>cookie named <cite>session_id</cite></li> <li>request param <cite>session_id</cite></li> </ul> <a name="logout"></a> <h3><a class="toc-backref" href="#id5">Logout</a></h3> <p>To logout you need to <code class="code">POST</code> a request on <code class="code">[ODOO HOST]/session/auth/logout</code> with an empty body.</p> <a name="changelog"></a> <h2><a class="toc-backref" href="#id6">Changelog</a></h2> <a name="id1"></a> <h3><a class="toc-backref" href="#id7">14.0.1.0.0</a></h3> <p>First official version.</p> <a name="id2"></a> <h3><a class="toc-backref" href="#id8">15.0.1.0.0</a></h3> <p>Second version.</p> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id9">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rest-framework/issues">GitHub Issues</a>. 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 <a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20base_rest_auth_user_service%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id10">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id11">Authors</a></h3> <ul class="simple"> <li>Wakari</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id12">Contributors</a></h3> <ul class="simple"> <li>François Degrave &lt;<a class="reference external" href="mailto:f.degrave&#64;wakari.be">f.degrave&#64;wakari.be</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id13">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>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.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/15.0/base_rest_auth_user_service">OCA/rest-framework</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>