本文整理汇总了Python中oic.utils.webfinger.WebFinger.httpd方法的典型用法代码示例。如果您正苦于以下问题:Python WebFinger.httpd方法的具体用法?Python WebFinger.httpd怎么用?Python WebFinger.httpd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.utils.webfinger.WebFinger
的用法示例。
在下文中一共展示了WebFinger.httpd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: discover
# 需要导入模块: from oic.utils.webfinger import WebFinger [as 别名]
# 或者: from oic.utils.webfinger.WebFinger import httpd [as 别名]
def discover(self, *arg, **kwargs):
wf = WebFinger(OIC_ISSUER)
wf.httpd = PBase()
_url = wf.query(kwargs["principal"])
self.trace.request("URL: %s" % _url)
url = wf.discovery_query(kwargs["principal"])
return url
示例2: WebFinger
# 需要导入模块: from oic.utils.webfinger import WebFinger [as 别名]
# 或者: from oic.utils.webfinger.WebFinger import httpd [as 别名]
import sys
from oic.oauth2 import PBase
from oic.utils.webfinger import OIC_ISSUER
from oic.utils.webfinger import WebFinger
__author__ = 'roland'
wf = WebFinger(OIC_ISSUER)
wf.httpd = PBase()
print (wf.discovery_query(sys.argv[1]))
示例3: WebFinger
# 需要导入模块: from oic.utils.webfinger import WebFinger [as 别名]
# 或者: from oic.utils.webfinger.WebFinger import httpd [as 别名]
#!/usr/bin/env python
import json
import requests
from oic.oauth2 import PBase
from oic.oic import OIDCONF_PATTERN
from oic.utils.webfinger import WebFinger
# This is a complete discovery example with OpenID Connect. After having retrieved the provide URL, its information
# is retrieved and printed. The standard URL format for obtaining OP information is:
# https://<op.servername>/.well-known/openid-configuration
userid = "[email protected]:8060"
wf = WebFinger()
wf.httpd = PBase(verify_ssl=False)
url = wf.discovery_query("acct:%s" % userid)
print "Provider:", url
if url[-1] == '/': url = url[:-1]
url = OIDCONF_PATTERN % url
print "Provider info url:", url
r = requests.request("GET", url, verify=False)
jwt = json.loads(r.text)
print "---- provider configuration info ----"
print json.dumps(jwt, sort_keys=True, indent=4, separators=(',', ': '))