使用OAuth2.o协议python进行社交身份验证



如何使用OAuth2.0从python向社交应用程序验证用户。我必须连接到颚骨api。

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)

现在所有的细节都在b 中

最新更新