【问题标题】:Ldap authentication with MoinMoin doesn't work使用 MoinMoin 的 Ldap 身份验证不起作用
【发布时间】:2013-01-22 16:40:37
【问题描述】:

我正在尝试将 MoinMoin 与我的 ldap 服务器连接,但它不起作用。我是否以正确的方式进行设置? 我正在使用 Ubuntu 存储库中的 MoinMoin。

这里我给你看我的farmconfig.py:

from farmconfig import FarmConfig

# now we subclass that config (inherit from it) and change what's different:
class Config(FarmConfig):

    # basic options (you normally need to change these)
    sitename = u'MyWiki' # [Unicode]
    interwikiname = u'MyWiki' # [Unicode]

    # name of entry page / front page [Unicode], choose one of those:

    # a) if most wiki content is in a single language
    #page_front_page = u"MyStartingPage"

    # b) if wiki content is maintained in many languages
    page_front_page = u"FrontPage"

    data_dir = '/usr/share/moin/data'
    data_underlay_dir = '/usr/share/moin/underlay'


from MoinMoin.auth.ldap_login import LDAPAuth
ldap_authenticator1 = LDAPAuth(
    server_uri='ldap://192.168.1.196',
    bind_dn='cn=admin,ou=People,dc=company,dc=com',
    bind_pw='secret',
    scope=2,
    referrals=0,
    search_filter='(uid=%(username)s)',
    givenname_attribute='givenName',
    surname_attribute='sn',
    aliasname_attribute='displayName',
    email_attribute='mailRoutingAddress',
    email_callback=None,
    coding='utf-8',
    timeout=10,
    start_tls=0,
    tls_cacertdir=None,
    tls_cacertfile=None,
    tls_certfile=None,
    tls_keyfile=None,
    tls_require_cert=0,
    bind_once=True,
    autocreate=True,
)
auth = [ldap_authenticator1, ]
cookie_lifetime = 1

【问题讨论】:

    标签: authentication ldap openldap moinmoin


    【解决方案1】:

    这是一个缩进问题,auth 和 cookie_lifetime 必须在类 Config 中(所以只需将所有内容缩进 4 个空格)。

    【讨论】:

    • 谢谢,这就是问题所在,缩进
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-16
    • 1970-01-01
    • 1970-01-01
    • 2017-04-20
    • 2012-08-30
    • 2015-12-04
    • 2011-01-12
    相关资源
    最近更新 更多