I am trying to build a custom integration between Salesforce and Odoo 16 Enterprise using a custom module and API key-based authentication.
What I’ve Done:
- Created a custom module with a @http.route('/sf/get_products', auth='api_key', type='json', methods=['POST'], csrf=False)
- Created a boolean field sfcost on product categories, used to filter products returned in the response
- Generated an API key from an Internal User (with Inventory/User access)
- Set auth_api_key = True in odoo.conf
- Restarted the Odoo service fully
Problem:
Despite all correct headers and method (Authorization: Bearer <key>, Content-Type: application/json, POST), Odoo always returns: odoo.exceptions.AccessDenied: Access Denied
I even created a test route /sf/ping to just return the user name and still get AccessDenied.
Can you elaborate on auth='api_key' since that's not actually a thing