Community mailing list archives

community@mail.odoo.com

Re: Odoo to PHP rest api authentication using oauth2

by
senthil
- 10/06/2016 01:53:57
for that php have to provide api and how to access it and so on.

that part can be handled easily in python and also can be  in odoo with some changes in python code.

On Thu, Oct 6, 2016 at 10:12 AM, Yaseen Shareef <mayashkhan@gmail.com> wrote:
The php side is implemented using rest api, and the communication I am talking about is from Odoo to php, not vice versa. If it was from php to odoo, I get your point. Do you have any idea about how oauth2 can be implemented for communications from Odoo to the rest api of the php system?

Thanks And Regards,
Yaseen Shareef

Odoo Developer/ Consultant
mayashkhan@gmail.com
Skype: yaseen.shareef91


On Thu, Oct 6, 2016 at 10:03 AM, <bornspy@gmail.com> wrote:
There is no need for those things u can jsonrpc or xmlrpc with db,username,password,port(optional).

I m curious how come consumer key,etc... Came here 🤔

Sent from my iPhone

On 6 அக்., 2016, at 9:42 முற்பகல், Yaseen Shareef <mayashkhan@gmail.com> wrote:

I am trying to implement a connection from Odoo to a php server which has a rest api, and at the php side, the oauth2 authentication is what is being used. So how can I do this from python, is there anyway to skip the callback uri step? I checked out a few steps, and the following is an example I found:

import oauth2 as oauth
import json

CONSUMER_KEY = "your app's consumer key"
CONSUMER_SECRET = "your app's consumer secret"
ACCESS_KEY = "your access token"
ACCESS_SECRET = "your access token secret"

consumer = oauth.Consumer(key=CONSUMER_KEY, secret=CONSUMER_SECRET)
access_token = oauth.Token(key=ACCESS_KEY, secret=ACCESS_SECRET)
client = oauth.Client(consumer, access_token)

timeline_endpoint = "https://api.twitter.com/1.1/statuses/home_timeline.json"
response, data = client.request(timeline_endpoint)

tweets = json.loads(data)
for tweet in tweets:
    print tweet['text']

But, its clearly not mentioned or recognizable as to how this would work in the Odoo scene of things, I mean what would be the consumer key and consumer secret in Odoo's case, and what about the access key and access secret. I really would like some insight from someone who has implemented something similar in Odoo. The end purpose is actually to create a user in the php system whenever a user is created in Odoo. I hope someone can answer this


Thanks And Regards,
Yaseen Shareef

Odoo Developer/ Consultant
mayashkhan@gmail.com
Skype: yaseen.shareef91

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe