On Mon, Jul 29, 2013 at 12:47 PM, Christian Meunier <[email protected]> wrote:
On 7/29/2013 17:21, Marius Dumitru Florea wrote:
On Mon, Jul 29, 2013 at 12:08 PM, Christian Meunier <[email protected]> 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.
Ok, can you check if $xcontext.userReference is good? (points to the main wiki?). Also, when you say "click on a user to bring up its profile" is this a link that you generate in the content of a document or the current user profile link from the top left corner (at the end of the top menu)? I would investigate how this link is generated. Hope this helps, Marius
I checked that I could reproduce the issue even if i am not using any custom authentication.
Should i log this as a bug in Jira ?
2) Empty servlet path support
The second thing I am struggling with is shortening the urls. I am following this guide:
But no matter what I try, I cannot make it work without the '/bin/ prefix. Please note that the xwiki is running under Jetty as the main context (mapped as '/') so the url I have is: server.com/WebHome which according to the short urls document should work.
it appears that the issue comes from StandardXWikiURLFactory: -------------------- String type = extendedURL.getSegments().get(0); if (type.equals("bin") || type.equals(this.configuration.getWikiPathPrefix())) { xwikiURL = this.entityURLFactory.createURL(extendedURL, parameters); } else { throw new UnsupportedURLException(String.format("URL type [%s] are not yet supported!", type)); } ----------------
What version of XWiki are you using? I think some changes have been made to the URL "parsing" code in 5.1. Vincent, WDYT?
I am using XWiki Enterprise 5.1
Thanks, Marius
Thanks a lot for your replay Marius !
-- Chris _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs