0

How can i authenticate a user from python using OAuth2.0 to a social app. I have to connect to jawbone api.

karthikr
  • 97,368
  • 26
  • 197
  • 188
slaveCoder
  • 519
  • 2
  • 17
  • 46

1 Answers1

1
email =('email')
pwd  = ('pwd')
data = urllib.parse.urlencode({'email': email, 'pwd':pwd, 'service': 'nudge'})
data = data.encode('utf-8')
request = urllib.request.Request("https://jawbone.com/user/signin/login")
# adding charset parameter to the Content-Type header.
request.add_header("Content-Type","application/x-www-form-urlencoded;charset=utf-8")
f = urllib.request.urlopen(request, data)

#print(f.read().decode('utf-8'))
j=(f.read().decode('utf-8'))
b=json.loads(j)

Now all details are in b

badcoder
  • 46
  • 4