Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

License: AGPL-3

Allow users to be automatically logged in

This module initialize the session by looking for the field HTTP_REMOTE_USER in the HEADER of the HTTP request and trying to bind the given value to a user. To be active, the module must be installed in the expected databases and loaded at startup; Add the –load parameter to the startup command:

--load=web,web_kanban,auth_from_http_remote_user, ...

If the field is found in the header and no user matches the given one, the system issue a login error page. (401 Unauthorized)

System parameter

By default this module does not allow the same user to connect from different browser sessions at the same time. It generates a new random pseudo-password (sso_key) that will be different at each session creation. To allow the same user to connect from different browser sessions, a system parameter can be configured with a secret. At session creation, the pseudo-password generated will be a hash based on the secret and the user id making the pseudo-password the same for each session of the same user. The system parameter key must be

http_remote_user.secret

and the value can be any string (Ex: 123456789abcdefgh).

Use case.

The module allows integration with external security systems [1] that can pass along authentication of a user via Remote_User HTTP header field. In many cases, this is achieved via server like Apache HTTPD or nginx proxying Odoo.

How to test the module with Apache [2]

Apache can be used as a reverse proxy providing the authentication and adding the required field in the Http headers.

Install apache:

$ sudo apt-get install apache2

Define a new vhost to Apache by putting a new file in /etc/apache2/sites-available:

$ sudo vi  /etc/apache2/sites-available/MY_VHOST.com

with the following content:

<VirtualHost *:80>
  ServerName MY_VHOST.com
  ProxyRequests Off
  <Location />
    AuthType Basic
    AuthName "Test Odoo auth_from_http_remote_user"
    AuthBasicProvider file
    AuthUserFile /etc/apache2/MY_VHOST.htpasswd
    Require valid-user

    RewriteEngine On
    RewriteCond %{LA-U:REMOTE_USER} (.+)
    RewriteRule . - [E=RU:%1]
    RequestHeader set Remote-User "%{RU}e" env=RU
  </Location>

  RequestHeader unset Remote-User early
  ProxyPass / http://127.0.0.1:8069/  retry=10
  ProxyPassReverse  / http://127.0.0.1:8069/
  ProxyPreserveHost On
</VirtualHost>

Enable the required apache modules:

$ sudo a2enmod headers
$ sudo a2enmod proxy
$ sudo a2enmod rewrite
$ sudo a2enmod proxy_http

Enable your new vhost:

$ sudo a2ensite MY_VHOST.com

Create the htpassword file used by the configured basic authentication:

$ sudo htpasswd -cb /etc/apache2/MY_VHOST.htpasswd admin admin
$ sudo htpasswd -b /etc/apache2/MY_VHOST.htpasswd demo demo

For local test, add the MY_VHOST.com in your /etc/vhosts file.

Finally reload the configuration:

$ sudo service apache2 reload

Open your browser and go to MY_VHOST.com. If everything is well configured, you are prompted for a login and password outside Odoo and are automatically logged in the system.

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

Credits

Images

  • Odoo Community Association: Icon.

Contributors

Maintainer

Odoo Community Association

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.

Metadata

Release files for odoo9-addon-auth-from-http-remote-user 9.0.1.0.0.99.dev17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo9-addon-auth-from-http-remote-user 9.0.1.0.0.99.dev17
File Interpreter ABI Platform Actions
odoo9_addon_auth_from_http_remote_user-9.0.1.0.0.99.dev17-py2-none-any.whl Python 2 none any Details for odoo9_addon_auth_from_http_remote_user-9.0.1.0.0.99.dev17-py2-none-any.whl

Release files / odoo9_addon_auth_from_http_remote_user-9.0.1.0.0.99.dev17-py2-none-any.whl

Download URL odoo9_addon_auth_from_http_remote_user-9.0.1.0.0.99.dev17-py2-none-any.whl
Size 80.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
6d09f2496281f4e066c6cb8c3d4a395a9938a79b110a3a12ba24001e7a7c629c
BLAKE2b-256 checksum
How to use checksums
cb856042c02255846ade23e9ca1d03c53e9368963aa26fcfb21576b7dc9dffb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Security for odoo9-addon-auth-from-http-remote-user 9.0.1.0.0.99.dev17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page