Skip to content

basic implementation of handling HTTP basic-auth#92

Closed
LUNEXTLABS-Tobi wants to merge 2 commits intoOCA:masterfrom
LUNEXTLABS-Tobi:basic_auth
Closed

basic implementation of handling HTTP basic-auth#92
LUNEXTLABS-Tobi wants to merge 2 commits intoOCA:masterfrom
LUNEXTLABS-Tobi:basic_auth

Conversation

@LUNEXTLABS-Tobi
Copy link
Copy Markdown

This implements a very basic handling of HTTP basic authentication

For this to work, the proxy will add a HTTPBasicAuthHandler with a HTTPPasswordMgrWithDefaultRealm to its opener. Whenever a server returns a 401 "Unauthorized", now urllib2 will automatically present supplied HTTP basic auth credentials.

The only thing users have to change in their code, in order to use basic authentication, is adding a parameter basic_auth=(url, user, pw) to their instantiation of odoorpc.

@LUNEXTLABS-Tobi LUNEXTLABS-Tobi marked this pull request as draft October 30, 2023 15:41
@LUNEXTLABS-Tobi
Copy link
Copy Markdown
Author

Looks like odoorpc already supports handling basic-auth by adjusting custom opener. If this holds true, please simply reject this PR.

@sebalix
Copy link
Copy Markdown
Collaborator

sebalix commented Apr 11, 2026

@LUNEXTLABS-Tobi you are right, opener parameter is here to support such use cases.
There is an example in the documentation of odoorpc.ODOO: https://pythonhosted.org/OdooRPC/ref_odoo.html#odoorpc.ODOO

Closing.

@sebalix sebalix closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants