This module is the FastAPI implementation of auth_partner it provides all the routes to manage the authentication of partners.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0This module connects Odoo's partner authentication system to FastAPI endpoints, letting external applications register, log in, reset passwords, and impersonate partners via API routes.
This module extends the FastAPI framework in Odoo to provide authentication for partners (customers, suppliers, etc.) through API endpoints. It adds a new "Authentication" menu under the FastAPI root menu, where you can manage authentication directories and partners.
On a FastAPI endpoint form, you can now select "Partner Auth" as the authentication method and link an authentication directory. The endpoint also gets fields for public URL and public API URL, used for impersonation redirects and email links.
Authentication directories gain settings for a cookie secret key (with a button to regenerate it), cookie duration (in minutes, default one year), and a sliding session option. These control how API sessions are secured and maintained.
For partners, a "Local Impersonate" button appears on the partner form (for administrators in developer mode). When clicked, it sets the authentication cookie for all FastAPI endpoints linked to the partner's directory, allowing you to test the API as that partner. If multiple endpoints exist, a wizard asks you to choose one.
The module also adds a field to the password reset wizard to specify a FastAPI endpoint, so reset emails can include the correct public URL.
Security rules restrict API users to only access their own partner record. The module provides API routes for registration, login, logout, email validation, password reset, profile retrieval, and impersonation.
Depends on
Menus it adds
Models and fields (6)
- auth.partner · extends an existing model
- auth.directory · extends an existing modelcookie_duration, sliding_session, cookie_secret_key, fastapi_endpoint_ids (FastAPI Endpoints)
- fastapi.endpoint · extends an existing modelapp, directory_id, is_auth_partner, demo_auth_method (Authentication method)
- fastapi.auth.service · new modelendpoint_id, directory_id
- wizard.auth.partner.impersonate · new modelauth_partner_id, auth_directory_id, fastapi_endpoint_id
- wizard.auth.partner.reset.password · extends an existing modelfastapi_endpoint_id
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 2 confirmed, 7 with no information of 9 versions.
Sources · Odoo 16.0
Confirmed on 2026-11-03 in branch 16.0 of OCA/rest-framework.
terminal Installation and usage
OCA documentation · Odoo 18.0Usage
Source · Odoo 18.0First you have to add the auth router to your FastAPI endpoint and the authentication dependency to your app dependencies:
from odoo.addons.fastapi import dependencies
from odoo.addons.fastapi_auth_partner.dependencies import (
auth_partner_authenticated_partner,
)
from odoo.addons.fastapi_auth_partner.routers.auth import auth_router
class FastapiEndpoint(models.Model):
_inherit = "fastapi.endpoint"
def _get_fastapi_routers(self):
if self.app == "myapp":
return [
auth_router,
]
return super()._get_fastapi_routers()
def _get_app_dependencies_overrides(self):
res = super()._get_app_dependencies_overrides()
if self.app == "myapp":
res.update(
{
dependencies.authenticated_partner_impl: auth_partner_authenticated_partner,
}
)
return resNext you can manage your authenticable partners and directories in the Odoo interface:
FastAPI \> Authentication \> Partner
and
FastAPI \> Authentication \> Directory
Next you must set the directory used for the authentication in the FastAPI endpoint:
FastAPI \> FastAPI Endpoint \> myapp \> Directory
Then you can use the auth router to authenticate your requests:
- POST /auth/register to register a partner
- POST /auth/login to authenticate a partner
- POST /auth/logout to unauthenticate a partner
- POST /auth/validate_email to validate a partner email
- POST /auth/request_reset_password to request a password reset
- POST /auth/set_password to set a new password
- GET /auth/profile to get the partner profile
- GET /auth/impersonate to impersonate a partner
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.