cosmocode/dokuwiki-plugin-oauth

Unable to login when register disabled

ypl-github opened this issue · 1 comments

We run a dokuwiki with oauth and action register disabled. When we
create a new user on the auth server, the user is not able to login at the
dokuwiki.

If I apply the following patch, things seem to work:

--- ./oauth/auth.php    2018-12-06 13:21:26.111007470 +0000
+++ ./oauth/auth.php.181206     2018-12-06 13:17:18.836280725 +0000
@@ -234,8 +234,7 @@
             $uinfo['user'] = $user;
             $uinfo['name'] = $sinfo['name'];
             $uinfo['grps'] = array_merge((array) $uinfo['grps'], $sinfo['grps']);
-       /* Dreckiger Hack -- AW */
-        } elseif(actionOK('reallyregister')) {
+        } elseif(actionOK('register')) {
             $ok = $this->addUser($uinfo, $servicename);
             if(!$ok) {
                 msg('something went wrong creating your user account. please try again later.', -1);

I am not sure if this really solves the problem, though.

First of all this patch seems to be reversed. Secondly, where does the reallyregister setting come from? Is there something missing?

Let me see if I understand what the actual problem is:

  • you have your own identity provider
  • you do not want random people to be able to register
  • you want people to selfregister when they login with your IdP

This kind of setup is currently not supported but should be relatively easy to add. In fact you probably are at the right place already but your implementation is a bit crude. A new config option should be introduced in the oauth plugin to enable this behaviour.