Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odoorpc.error.RPCError: Access Denied when using API Key #64

Open
fotisp opened this issue Aug 19, 2021 · 7 comments
Open

odoorpc.error.RPCError: Access Denied when using API Key #64

fotisp opened this issue Aug 19, 2021 · 7 comments
Labels
Milestone

Comments

@fotisp
Copy link

fotisp commented Aug 19, 2021

When using the new "API Keys" functionality on Odoo 14.0, the authentication fails with an authentication denied error message.

#
# # Prepare the connection to the server
odoo = odoorpc.ODOO('localhost, port='8069')

odoo.login('odoo', 'admin', 'b934327276dca39fe1081327bf3f8e8b780da22e0')

The error

File "/tmp/src/odoorpc/odoo.py", line 345, in login
{'db': db, 'login': login, 'password': password},
File "/tmp/src/odoorpc/odoo.py", line 274, in json
data['error']['data']['message'], data['error']
odoorpc.error.RPCError: Access Denied python-BaseException

The same code with the actual user password works fine.

Furthermore the vanilla code

import xmlrpc.client


url = 'http://localhost:8069'
db = 'odoo'
username = 'admin'
password = 'b934327276dca39fe1081327bf3f8e8b780da22e0'

common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
common.version()

uid = common.authenticate(db, username, password, {})
print(common.version())

print(uid)

Works just fine.

I have tried this in Master.

@fotisp
Copy link
Author

fotisp commented Aug 19, 2021

This is caused by this odoo/odoo#75331 unless I am missing something.

@fotisp
Copy link
Author

fotisp commented Aug 22, 2021

Ok so based on odoo/odoo#75331, OdooRPC is using the session based authentication. Should I close this, or keep it open for future reference?

@bizzappdev
Copy link

@fotisp does this mean OdooRPC will not work with API Key?

@fotisp
Copy link
Author

fotisp commented Nov 24, 2021

Hello @bizzappdev, yes it won't work right now

@sebalix
Copy link
Collaborator

sebalix commented Sep 30, 2022

I want to implement this for release v0.10.0, I won't have time to add this for the upcoming v0.9.0 that will be published in a couple of days. So I keep this issue open.

@sebalix sebalix added the bug label Sep 30, 2022
@sebalix sebalix added this to the v0.10.0 milestone Sep 30, 2022
@Vonken
Copy link

Vonken commented Nov 18, 2023

Using the REST API from Postman using the url "/web/session/authenticate" and having the same issue. Access Denied when using the API Key insted of the password.

@flotho
Copy link
Member

flotho commented Jun 12, 2024

need to be closed as it's the expected behaviour from Odoo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants