本文整理汇总了Python中oic.oic.consumer.Consumer.issuer_query方法的典型用法代码示例。如果您正苦于以下问题:Python Consumer.issuer_query方法的具体用法?Python Consumer.issuer_query怎么用?Python Consumer.issuer_query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oic.consumer.Consumer
的用法示例。
在下文中一共展示了Consumer.issuer_query方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Consumer
# 需要导入模块: from oic.oic.consumer import Consumer [as 别名]
# 或者: from oic.oic.consumer.Consumer import issuer_query [as 别名]
CLIENT_FUNCTION = {
"openid_request": construct_openid_request,
}
# Start with dynamic discovery
client_config = {}
c = Consumer(None, client_config)
# emulating this
#res = c.discover(principal)
principal = "[email protected]"
domain = c.get_domain(principal)
uri = c.issuer_query(SWD_PATTERN % domain, principal)
# ----- On the server side -----
app = TestApp(application)
result = app.get(uri, extra_environ={"oic.server":SERVER, "mako.lookup":LOOKUP})
# ++++ client side, parse the result ++++
assert result.status == "200 OK"
res = json.loads(result.body)
# location of the authorization server
as_loc = OIDCONF_PATTERN % res["locations"][0]
app = TestApp(application)