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


Python Population.get_entityid方法代码示例

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


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

示例1: Base

# 需要导入模块: from saml2.population import Population [as 别名]
# 或者: from saml2.population.Population import get_entityid [as 别名]

#.........这里部分代码省略.........

        if attribute:
            attribute = do_attributes(attribute)

        return self._message(AttributeQuery, destination, id, consent,
                             extensions, sign, subject=subject,
                             attribute=attribute)


    def create_logout_request(self, destination, issuer_entity_id,
                              subject_id=None, name_id=None,
                              reason=None, expire=None,
                              id=0, consent=None, extensions=None, sign=False):
        """ Constructs a LogoutRequest
        
        :param destination: Destination of the request
        :param issuer_entity_id: The entity ID of the IdP the request is
            target at.
        :param subject_id: The identifier of the subject
        :param name_id: A NameID instance identifying the subject
        :param reason: An indication of the reason for the logout, in the
            form of a URI reference.
        :param expire: The time at which the request expires,
            after which the recipient may discard the message.
        :param id: Request identifier
        :param consent: Whether the principal have given her consent
        :param extensions: Possible extensions
        :param sign: Whether the query should be signed or not.
        :return: A LogoutRequest instance
        """

        if subject_id:
            name_id = saml.NameID(
                text = self.users.get_entityid(subject_id, issuer_entity_id,
                                               False))
        if not name_id:
            raise Exception("Missing subject identification")

        return self._message(LogoutRequest, destination, id,
                             consent, extensions, sign, name_id=name_id,
                             reason=reason, not_on_or_after=expire)

    def create_logout_response(self, idp_entity_id, request_id,
                                       status_code,
                                       binding=BINDING_HTTP_REDIRECT):
        """ Constructs a LogoutResponse

        :param idp_entity_id: The entityid of the IdP that want to do the
            logout
        :param request_id: The Id of the request we are replying to
        :param status_code: The status code of the response
        :param binding: The type of binding that will be used for the response
        :return: A LogoutResponse instance
        """

        destination = self.config.single_logout_services(idp_entity_id,
                                                         binding)[0]

        status = samlp.Status(
            status_code=samlp.StatusCode(value=status_code))

        return destination, self._message(LogoutResponse, destination,
                                          in_response_to=request_id,
                                          status=status)

    # MUST use SOAP for
开发者ID:paulftw,项目名称:pysaml2,代码行数:70,代码来源:client_base.py


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