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


Python UsernamePasswordMako.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from oic.utils.authn.user import UsernamePasswordMako [as 别名]
# 或者: from oic.utils.authn.user.UsernamePasswordMako import __init__ [as 别名]
    def __init__(self, srv, ldapsrv, return_to, pattern, mako_template,
                 template_lookup, ldap_user="", ldap_pwd="",
                 verification_endpoints=["verify"]):
        """
        :param srv: The server instance
        :param ldapsrv: Which LDAP server to us
        :param return_to: Where to send the user after authentication
        :param pattern: How to find the entry to log in to.
            Expected to be a dictionary where key is one of "dn" or "search".
            And the value a dictionary with values depends on the key:
            If "dn" only "pattern".
            If "search": "base", "filterstr", "scope"
                "base" and "filterstr" MUST be present
        :param ldap_user: If a search has to be done first which user to do
            that as. "" is a anonymous user
        :param ldap_pwd: The password for the ldap_user
        """
        UsernamePasswordMako.__init__(
            self, srv, mako_template, template_lookup, None, return_to,
            verification_endpoints=verification_endpoints)

        self.ldap = ldap.initialize(ldapsrv)
        self.ldap.protocol_version = 3
        self.ldap.set_option(ldap.OPT_REFERRALS, 0)
        self.pattern = pattern
        self.ldap_user = ldap_user
        self.ldap_pwd = ldap_pwd
开发者ID:Magosgruss,项目名称:pyoidc,代码行数:29,代码来源:ldapc.py


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