本文整理汇总了Python中oic.oic.consumer.Consumer.user_info_request方法的典型用法代码示例。如果您正苦于以下问题:Python Consumer.user_info_request方法的具体用法?Python Consumer.user_info_request怎么用?Python Consumer.user_info_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oic.consumer.Consumer
的用法示例。
在下文中一共展示了Consumer.user_info_request方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resp
# 需要导入模块: from oic.oic.consumer import Consumer [as 别名]
# 或者: from oic.oic.consumer.Consumer import user_info_request [as 别名]
# print "GSess: %s" % _cli.grant
kaka = http_util.cookie(CONSUMER_CONFIG["name"], _cli.state, _cli.seed,
expire=360, path="/")
resp = http_util.Response("Your will is registered", headers=[kaka])
return resp(environ, start_response)
capp = TestApp(handle_authz_response)
cres = capp.get(url)
assert cres.status == "200 OK"
#print cres.headers
assert "Set-Cookie" in cres.headers.keys()
# get the userinfo
# construct what the client sends to the server
_oac = Consumer(SESSION_DB, CONSUMER_CONFIG, CLIENT_CONFIG, SERVER_INFO)
for key, val in _oac.sdb.items():
if key.startswith("seed:"):
_oac.restore(val)
path, method, h_args = _oac.user_info_request()
# Let the server deal with the request
res = app.get(path, extra_environ={"oic.server":SERVER, "mako.lookup":LOOKUP})
print res
assert res.status == "200 OK"
assert res.body == '{"verified": true, "name": "Curtis Granderson", "email": "[email protected]"}'