2

I have a server on which I am using dokuwiki to host both a homepage as well as a wiki. The server is available under www.domain.com and the wiki is available under wiki.domain.com. Internally both subdomains are served from different directories.

However this means, that everybody who wants to sign up has to sign up for the both domains and manage a duplicate set of user accounts for both subdomains.

What I would like is to have a system, where anybody can sign up on both pages and only has to log in in any of the domains and get access. ACL should still be managed separately for both domains, since I might use namespace names multiple times.

I looked through the list oft dokuwiki auth plugins, but I was not able to find anything usefull for this purpose. Another idea would be to just soft- or hardlink the auth data directory in the two installations. However this would still mean users would have to log in multiple times. Also I am not sure whether my hoster actually allows such directory links, or if this might mess up the two installations.

Is there any other way to create such a setup?

LiKao
  • 10,408
  • 6
  • 53
  • 91

3 Answers3

5

A DokuWiki farm setup might help with having the same user database for both sites. Symlinking the user file is another way.

More complicated is to share the cookies between both domains. I'm not sure how to approach this best. Maybe others can offer some ideas.

Andreas Gohr
  • 4,617
  • 5
  • 28
  • 45
  • That looks very helpful. I'll have a good look at the documentation tonight and then I'll see if this really works. – LiKao Jan 31 '12 at 16:08
  • wiki farm works fine (we currently manage 80 wikis), it's the best way to setup a SSO between 2 web sites. Cookies don't work if you have 2 subdomains levels : eg : www.domain.ntld and wiki.domain.ntld will work fine but www.domain.ntld and wiki1.wiki.domain.ntld won't work because of an HTTP restriction (http://www.ietf.org/rfc/rfc2109.txt) an article (sorry, in french) on this topic (WebSSO/wiki farm) http://blog.olivier-duval.info/?post/dokuWiki-et-integration-SSO-annuaire-modeles-co – Olivier DUVAL Feb 23 '12 at 10:12
  • I didn't think about the symlink -- brilliant idea, thanks! It doesn't get any simpler than that. Thanks for your great work on DokuWiki, Andreas! =) – PrimaryFeather Apr 06 '12 at 06:19
0

Well since this is on the same server just across your various subdomains I would imagine you would want to store the user info including logins in a shared database so that no matter which app/subdomain you insert their registration data and query for their login info from the same database. Then it's a matter of using PHP sessions for keeping track of if they are logged in across subdomains. There is already a length stack on how to achieve that here:

PHP Sessions across sub domains

Community
  • 1
  • 1
Jeff
  • 370
  • 1
  • 2
  • 11
  • Unfortunately dokuwiki is not using a "database" in the conventional sense. The database is made up of a set of text files in the hosting directory, so this is probably very specific. That is why I had the idea of sharing the auth directory, but because dokuwiki is handling it's own database I am unsure if this would break anything. – LiKao Jan 31 '12 at 09:13
0

Try setting the Cookie Domain to .yourdomain.com This means your browser will deliver cookies to subdomains of yourdomain.com.

So cookies will beshared among www.yourdomain.com and wiki.yourdomain.com

Dashu
  • 1