Skip to Content
Menu
v 16.0 Third Party 1
Download for v 16.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Community Apps Dependencies
Lines of code 7172
Technical Name fastapi_auth_partner
LicenseAGPL-3
Websitehttps://github.com/OCA/rest-framework
You bought this module and need support? Click here!
Odoo Community Association

Fastapi Auth Partner

Beta License: AGPL-3 OCA/rest-framework Translate me on Weblate Try me on Runboat

This module is the FastAPI implementation of auth_partner it provides all the routes to manage the authentication of partners.

Table of contents

Usage

First 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 res

Next 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

Bug Tracker

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 to smash it by providing a detailed and welcomed feedback.

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

Credits

Authors

  • Akretion

Contributors

  • Akretion:
    • Sébastien Beau
    • Florian Mounier

Maintainers

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.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.