This question about Authentication or Authorisation: Answered

apparently no mapping between login (against LDAP) and wikiname

Hello,

I've done a fresh new installation of Foswiki.

I come from an experience of years on TWiki 4.1.2 and had no problem in user mapping.

Now I'm trying to replicate the same scenario on this new Foswiki install, where I authenticate on LDAP using apache authentication.

Here is my LocalSite.cfg interested lines:

$Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::ApacheLogin';
$Foswiki::cfg{UserMappingManager} = 'Foswiki::Users::TopicUserMapping';
$Foswiki::cfg{Register}{AllowLoginName} = 1;

I do not use Template Login (as you can see above).

My login names are of the type daniele antoniazzi and in my past TWiki install they were mapped correctly to DanieleAntoniazzi, so that I can set permissions defining groups based on wikinames. Surely I've registered to this new installation, so that in WikiUsers I have the correct line like this:

   * DanieleAntoniazzi - daniele antoniazzi - 18 Aug 2010

Now I see the following:
  • login is performed correctly against my corporate LDAP server
  • on the top left I see danieleantoniazzi while I would expect the wikiname. Actually I see that % WIKINAME% expands to my login without the space in the middle
  • when I create a topic (in Sandbox) the author is this:
META:TOPICINFO{author="daniele_20antoniazzi" date="1282225254" format="1.1" version="1.1"}%
  • permissions assigned with groups, using DanieleAntoniazzi are not working, and not even for login or login without blank
Could you please help me? Many thanks in advance Cheers Daniele

-- DanieleAntoniazzi - 19 Aug 2010

Is there a reason why you're not using LdapContrib? I've used in in TWiki as well as Foswiki and have no problems regarding authentication and user mapping. Personally, I've never used Apache authentication, so I can't help you there.

-- MartinKaufmann - 19 Aug 2010

Hello Martin, thanks for prompt answer!

I discarded the option for LdapContrib because seen in the support area lots of questions on it and I scared a bit smile

My feeling is that, whatever auth it performs, there is something I miss to tell to Foswiki how to perform the mapping correctly. I'm quite sure that from apache Foswiki gets back the right account daniele antoniazzi and something breaks in the middle so that WikiUsers is not read correctly.

I removed the T option in most of the scripts in fowsiki/bin dir because the taint was stopping write of Foswiki to filesystem. I'm quite sure that this has nothing to do with that mapping story, btw, this is the only problem I had after installation... smile

Cheers

-- DanieleAntoniazzi - 19 Aug 2010

FANTASTICO! I've found where was the problem and fixed it. In short the problem is that our logins contain a blank between name and surname, like: daniele antoniazzi, and this blank gets confused the user mapping stuff. For those that could have the same problem, here is the solution:

file: lib/Foswiki/Users/TopicUserMapping.pm

sub: _loadMapping

line: 1132 (should be... the one with big regexp)

here is the whole line that I've changed:
s/^\s*\* (?:$Foswiki::regex{webNameRegex}\.)?($Foswiki::regex{wikiWordRegex})\s*(?:-\s*([a-z-_ ]+)\s+)?-.*$/(_cacheUser( $this, $1, $2)||'')/gome;

Hope this can help someone else.

Ciao

-- DanieleAntoniazzi - 20 Aug 2010

QuestionForm edit

Subject Authentication or Authorisation
Extension
Version Foswiki 1.0.9
Status Answered
Topic revision: r4 - 20 Aug 2010, DanieleAntoniazzi
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy