【问题标题】:Using OAuth2.o protocol python for social authentication使用 OAuth2.o 协议 python 进行社交认证
【发布时间】:2014-03-30 22:36:28
【问题描述】:

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

【问题讨论】:

    标签: python python-2.7 oauth oauth-2.0 jawbone


    【解决方案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)
    

    现在所有细节都在 b 中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多