本文整理汇总了Python中oic.oic.message.RegistrationResponse.keys方法的典型用法代码示例。如果您正苦于以下问题:Python RegistrationResponse.keys方法的具体用法?Python RegistrationResponse.keys怎么用?Python RegistrationResponse.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oic.message.RegistrationResponse
的用法示例。
在下文中一共展示了RegistrationResponse.keys方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_registration_endpoint_openid4us
# 需要导入模块: from oic.oic.message import RegistrationResponse [as 别名]
# 或者: from oic.oic.message.RegistrationResponse import keys [as 别名]
def test_registration_endpoint_openid4us(self):
req = RegistrationRequest(
**{'token_endpoint_auth_method': u'client_secret_post',
'redirect_uris': [
u'https://connect.openid4.us:5443/phpRp/index.php/callback',
u'https://connect.openid4.us:5443/phpRp/authcheck.php/authcheckcb'],
'jwks_uri': u'https://connect.openid4.us:5443/phpRp/rp/rp.jwk',
'userinfo_encrypted_response_alg': u'RSA1_5',
'contacts': [u'[email protected]'],
'userinfo_encrypted_response_enc': u'A128CBC-HS256',
'application_type': u'web',
'client_name': u'ABRP-17',
'grant_types': [u'authorization_code', u'implicit'],
'post_logout_redirect_uris': [
u'https://connect.openid4.us:5443/phpRp/index.php/logoutcb'],
'subject_type': u'public',
'response_types': [u'code', u'token', u'id_token', u'code token',
u'code id_token', u'id_token token',
u'code id_token token'],
'policy_uri': u'https://connect.openid4.us:5443/phpRp/index.php/policy',
'logo_uri': u'https://connect.openid4.us:5443/phpRp/media/logo.png'})
resp = self.provider.registration_endpoint(request=req.to_json())
regresp = RegistrationResponse().deserialize(resp.message, "json")
assert _eq(regresp.keys(), list(req.keys()) +
['registration_client_uri',
'client_secret_expires_at',
'registration_access_token',
'client_id', 'client_secret',
'client_id_issued_at'])
示例2: test_deserialize
# 需要导入模块: from oic.oic.message import RegistrationResponse [as 别名]
# 或者: from oic.oic.message.RegistrationResponse import keys [as 别名]
def test_deserialize(self):
msg = {
"client_id": "s6BhdRkqt3",
"client_secret": "ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk",
"client_secret_expires_at": 1577858400,
"registration_access_token": "this.is.an.access.token.value.ffx83",
"registration_client_uri":
"https://server.example.com/connect/register?client_id"
"=s6BhdRkqt3",
"token_endpoint_auth_method": "client_secret_basic",
"application_type": "web",
"redirect_uris": ["https://client.example.org/callback",
"https://client.example.org/callback2"],
"client_name": "My Example",
"client_name#ja-Jpan-JP": "クライアント名",
"logo_uri": "https://client.example.org/logo.png",
"subject_type": "pairwise",
"sector_identifier_uri":
"https://other.example.net/file_of_redirect_uris.json",
"jwks_uri": "https://client.example.org/my_public_keys.jwks",
"userinfo_encrypted_response_alg": "RSA1_5",
"userinfo_encrypted_response_enc": "A128CBC+HS256",
"contacts": ["[email protected]", "[email protected]"],
"request_uris": [
"https://client.example.org/rf.txt"
"#qpXaRLh_n93TTR9F252ValdatUQvQiJi5BDub2BeznA"]
}
resp = RegistrationResponse().deserialize(json.dumps(msg), "json")
assert _eq(msg.keys(), resp.keys())
示例3: test_registration_endpoint
# 需要导入模块: from oic.oic.message import RegistrationResponse [as 别名]
# 或者: from oic.oic.message.RegistrationResponse import keys [as 别名]
def test_registration_endpoint(self):
req = RegistrationRequest()
req["application_type"] = "web"
req["client_name"] = "My super service"
req["redirect_uris"] = ["http://example.com/authz"]
req["contacts"] = ["[email protected]"]
req["response_types"] = ["code"]
resp = self.provider.registration_endpoint(request=req.to_json())
regresp = RegistrationResponse().deserialize(resp.message, "json")
assert _eq(
regresp.keys(),
[
"redirect_uris",
"contacts",
"application_type",
"client_name",
"registration_client_uri",
"client_secret_expires_at",
"registration_access_token",
"client_id",
"client_secret",
"client_id_issued_at",
"response_types",
],
)
示例4: test_registration_endpoint
# 需要导入模块: from oic.oic.message import RegistrationResponse [as 别名]
# 或者: from oic.oic.message.RegistrationResponse import keys [as 别名]
def test_registration_endpoint(self):
req = RegistrationRequest()
req["application_type"] = "web"
req["client_name"] = "My super service"
req["redirect_uris"] = ["http://example.com/authz"]
req["contacts"] = ["[email protected]"]
req["response_types"] = ["code"]
print req.to_dict()
resp = self.server.registration_endpoint(request=req.to_json())
print resp.message
regresp = RegistrationResponse().deserialize(resp.message, "json")
print regresp.keys()
assert _eq(regresp.keys(), ['redirect_uris', 'contacts', 'application_type',
'client_name', 'registration_client_uri',
'client_secret_expires_at',
'registration_access_token',
'client_id', 'client_secret',
'client_id_issued_at', 'response_types'])
示例5: test_registration_endpoint
# 需要导入模块: from oic.oic.message import RegistrationResponse [as 别名]
# 或者: from oic.oic.message.RegistrationResponse import keys [as 别名]
def test_registration_endpoint():
server = provider_init
req = RegistrationRequest(operation="register")
req["application_type"] = "web"
req["client_name"] = "My super service"
req["redirect_uris"] = ["http://example.com/authz"]
req["contacts"] = ["[email protected]"]
environ = BASE_ENVIRON.copy()
environ["QUERY_STRING"] = req.to_urlencoded()
resp = server.registration_endpoint(environ, start_response)
print resp
regresp = RegistrationResponse().deserialize(resp[0], "json")
print regresp.keys()
assert _eq(regresp.keys(), ['redirect_uris', 'application_type',
'expires_at', 'registration_access_token',
'client_id', 'client_secret', 'client_name',
"contacts"])
# --- UPDATE ----
req = RegistrationRequest(operation="client_update")
req["application_type"] = "web"
req["client_name"] = "My super duper service"
req["redirect_uris"] = ["http://example.com/authz"]
req["contacts"] = ["[email protected]"]
environ = BASE_ENVIRON.copy()
environ["QUERY_STRING"] = req.to_urlencoded()
environ["HTTP_AUTHORIZATION"] = "Bearer %s" % regresp["registration_access_token"]
resp = server.registration_endpoint(environ, start_response)
print resp
update = RegistrationResponse().deserialize(resp[0], "json")
print update.keys()
assert _eq(update.keys(), ['redirect_uris', 'application_type',
'expires_at', 'registration_access_token',
'client_id', 'client_secret', 'client_name',
'contacts'])