On Mon, Jul 29, 2013 at 12:08 PM, Christian Meunier
<christian.meunier(a)magelo.com> wrote:
Hi All,
I sent 2 emails to the users list without much success and I am hoping
that
I might find a more suitable audience for my somewhat technical issues
with
the devs.
1) Global users in sub wiki.
In the system I am trying to setup, all the users are created using a
custom
auth module in the main wiki (Global users), so there will be no local
users. The issue is that on a sub wiki, when you click on a user to bring
up
its profile, you end up on a document not found.
From the auth module, the
principal returned is prefixed with the 'XWiki.' so the system should be
able to differentiate between local and global users and act accordingly.
'XWiki' is the space name, and you have this space both in the local
and the global wiki. In order to make sure the user is from the global
wiki you need to use the full/absolute user reference:
wiki:XWiki.userName. So your auth module should return something like
xwiki:XWIki.mflorea, where 'xwiki' is the main wiki, and 'mflorea' is
the user alias used to login. On the Java side you should use the
DocumentReference and the DocumentReferenceSerializer.
My bad, actually I am already doing that (Used the custom http auth module
as foundation for my own module)
String validUserName = username;
String validUserFullName = "XWiki." + validUserName;
if (context.isMainWiki()) {
return new SimplePrincipal(validUserFullName);
} else {
return new SimplePrincipal(context.getMainXWiki() + ":" +
validUserFullName);}
}
So in case of a sub wiki, I do return "xwiki:XWiki.mflorea" already. Just
checked with a remote debugger to be sure.