• 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.

Item6417: LDAP users can't login if UserMappingManager 'TWiki::Users::TWikiUserMapping' is used

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension TWikiUserMapping Normal Closed   patch 5.0.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

This configuration:

$TWiki::cfg{UserMappingManager} = 'TWiki::Users::TWikiUserMapping';
$TWiki::cfg{Register}{EnableNewUserRegistration} = 1;
$TWiki::cfg{Register}{AllowLoginName} = 1;
$TWiki::cfg{PasswordManager} = 'TWiki::Users::LdapUser';

is intended to allow people to login via LDAP and to have user registration in TWiki where people have their profile pages. At the time of registration they can set their WikiName and login name, and TWiki keeps track of mapping from login name to WikiName based on the Main.TWikiUsers topic.

The login/password/usermapping managers interactions are overly complex in TWiki. Above configuration does not work because the password manager asks the TWiki::Users::TWikiUserMapping manager if it can handle the user (via call to handlesUser). This fails because the user is not yet registered. Because 0 is returned, the TWiki::Users::BaseUserMapping manager is used, which results in users not being able to login via LDAP, even though the cache.db file has all users cached properly.

Fix:

--- lib/TWiki/Users/TWikiUserMapping.pm   (revision 18394)
+++ lib/TWiki/Users/TWikiUserMapping.pm   (working copy)
@@ -158,6 +158,10 @@
     # Check the login id to see if we know it
    return 1 if ($login && $this->_userReallyExists( $login ));
 
+    # FIXME: Hack to make PasswordManager 'TWiki::Users::LdapUser' work with
+    # UserMappingManager 'TWiki::Users::TWikiUserMapping'
+    return 1 if ( $TWiki::cfg{PasswordManager} eq 'TWiki::Users::LdapUser' );
+
     # Or the wiki name
    if ($wikiname) {
         _loadMapping($this); # Sorry Sven, has to be done

-- TWiki:Main/PeterThoeny - 01 Apr 2010

This is now in SVN trunk and 4.3 branch, as well as package TWiki:Plugins/TWikiUserMapping

-- TWiki:Main.PeterThoeny - 02 Apr 2010

ItemTemplate
Summary LDAP users can't login if UserMappingManager 'TWiki::Users::TWikiUserMapping' is used
ReportedBy TWiki:Main.PeterThoeny
Codebase 4.3.2, ~twiki4
SVN Range TWiki-5.0.0, Fri, 19 Mar 2010, build 18391
AppliesTo Extension
Component TWikiUserMapping
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:18416 TWikirev:18417
TargetRelease patch
ReleasedIn 5.0.0
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r6 - 2010-05-31 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback