当前位置: 首页>>代码示例>>Python>>正文


Python Server.parse_manage_name_id_request方法代码示例

本文整理汇总了Python中saml2.server.Server.parse_manage_name_id_request方法的典型用法代码示例。如果您正苦于以下问题:Python Server.parse_manage_name_id_request方法的具体用法?Python Server.parse_manage_name_id_request怎么用?Python Server.parse_manage_name_id_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在saml2.server.Server的用法示例。


在下文中一共展示了Server.parse_manage_name_id_request方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_flow

# 需要导入模块: from saml2.server import Server [as 别名]
# 或者: from saml2.server.Server import parse_manage_name_id_request [as 别名]
def test_flow():
    sp = Saml2Client(config_file="servera_conf")
    idp = Server(config_file="idp_all_conf")

    binding, destination = sp.pick_binding("manage_name_id_service",
                                           entity_id=idp.config.entityid)

    nameid = NameID(format=NAMEID_FORMAT_TRANSIENT, text="foobar")
    newid = NewID(text="Barfoo")

    mid, midq = sp.create_manage_name_id_request(destination, name_id=nameid,
                                                 new_id=newid)

    print midq
    rargs = sp.apply_binding(binding, "%s" % midq, destination, "")

    # --------- @IDP --------------

    _req = idp.parse_manage_name_id_request(rargs["data"], binding)

    print _req.message

    mnir = idp.create_manage_name_id_response(_req.message, [binding])

    if binding != BINDING_SOAP:
        binding, destination = idp.pick_binding("manage_name_id_service",
                                                entity_id=sp.config.entityid)
    else:
        destination = ""

    respargs = idp.apply_binding(binding, "%s" % mnir, destination, "")

    print respargs

    # ---------- @SP ---------------

    _response = sp.parse_manage_name_id_request_response(respargs["data"],
                                                         binding)

    print _response.response

    assert _response.response.id == mnir.id
开发者ID:5monkeys,项目名称:pysaml2,代码行数:44,代码来源:test_67_manage_name_id.py

示例2: test_basic

# 需要导入模块: from saml2.server import Server [as 别名]
# 或者: from saml2.server.Server import parse_manage_name_id_request [as 别名]
def test_basic():
    sp = Saml2Client(config_file="servera_conf")
    idp = Server(config_file="idp_all_conf")

    # -------- @SP ------------
    binding, destination = sp.pick_binding("manage_name_id_service", entity_id=idp.config.entityid)

    nameid = NameID(format=NAMEID_FORMAT_TRANSIENT, text="foobar")
    newid = NewID(text="Barfoo")

    mid, mreq = sp.create_manage_name_id_request(destination, name_id=nameid, new_id=newid)

    print mreq
    rargs = sp.apply_binding(binding, "%s" % mreq, destination, "")

    # --------- @IDP --------------

    _req = idp.parse_manage_name_id_request(rargs["data"], binding)

    print _req.message

    assert mid == _req.message.id
开发者ID:jaywink,项目名称:pysaml2,代码行数:24,代码来源:test_67_manage_name_id.py


注:本文中的saml2.server.Server.parse_manage_name_id_request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。