Skip to Content
Menu
This question has been flagged
1 Reply
7901 Views

Dears,

I have Odoo 8 installed with Nginx https enabled, How can I connect to the web api securely?, the following code raise an error (Access denied), is this the right way to deal with https connection?

thank you,


Odoo Configuration:

xmlrpc_port = 9004
host = mydomain

URL accessed from Browser: https://mydomain/

def connect_to_server():

       import xmlrpclib

        username = 'sam@sam.com' #the user
        pwd = 'pwdpwd'
        dbname = 'db1'    #the database
        url = 'https://mydomain'
        ws_common = xmlrpclib.ServerProxy('{}/xmlrpc/common'.format(url))
        ws_common.login(dbname, username, pwd)
 
Results:
   
Server Side Error Log:
openerp.service.common: bad login or password from 'sam@sam.com' using database 'db1'

Client side error Log:
  File "/usr/lib/python2.7/xmlrpclib.py", line 800, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 3: 'Access denied.'>

Avatar
Discard
Best Answer

Hi Salim,

Just try with common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url)).

Also please refer https://www.odoo.com/documentation/8.0/api_integration.html

Hope this will help!

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 22
2486
0
May 16
6151
3
Mar 15
5605
2
Nov 23
16910
2
Aug 24
7036