• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7395: Cannot login using TWiki::Users::LdapPasswdUser and {Ldap}{Precache} = 0

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension LdapContrib Normal New Waiting for Feedback n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


After installing LdapContrib if you need to login using Ldap password you must enable TWiki::Users::LdapPasswdUser also you must set {Ldap}{Precache} = 1 if not is not possible to login.

I think that all data from LDAP db are prefetched in TWiki cache

Unfortunately seems that this strategy does not correctly handle MISS elements in TWiki cache

Looking inside LdapContrib code i found that function getDnOfLogin could return no dn string if $loginName is not in TWiki cache


sub getDnOfLogin {
    my ($this, $loginName, $data) = @_;

    return unless $loginName;
    $loginName = lc( $loginName ) unless $this->{caseSensitiveLogin};

    $data ||= $this->{data};

    return TWiki::Sandbox::untaintUnchecked($data->{"U2DN::$loginName"});

To solve this problem i had modified getDnOfLogin to solve MISS in TWiki cache

sub getDnOfLogin {
    my ($this, $loginName, $data) = @_;

    return unless $loginName;
    $loginName = lc( $loginName ) unless $this->{caseSensitiveLogin};

    $data ||= $this->{data};
    my $dn = TWiki::Sandbox::untaintUnchecked($data->{"U2DN::$loginName"});

    # Cache single account
    if (defined($dn) || $dn eq '') {
        # Make sure the user has been retreived from LDAP
        $this->checkCacheForLoginName($loginName, $data);
        $dn = TWiki::Sandbox::untaintUnchecked($data->{"U2DN::$loginName"});

    return $dn;

-- TWiki:Main/MauroFasolo - 2013-12-04

Grazie Mauro for reporting this and for supplying a fix! Someone needs to update the LdapContrib.

-- TWiki:Main.PeterThoeny - 2013-12-04

Summary Cannot login using TWiki::Users::LdapPasswdUser and {Ldap}{Precache} = 0
ReportedBy TWiki:Main.MrYattle
Codebase 6.0.0
SVN Range TWiki-6.0.1-trunk, Wed, 04 Dec 2013, build 26649
AppliesTo Extension
Component LdapContrib
Priority Normal
CurrentState New
WaitingFor Waiting for Feedback

TargetRelease n/a

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r2 - 2013-12-04 - PeterThoeny
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback