[dokuwiki] Re: External authentication with login button

  • From: GERARD Nicolas <gerardnico@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 26 May 2023 20:42:21 +0200

Hi Marc,

I have no idea why, as I have never worked on this topic.
But I can give you where the visibility decision is made.

Here:
https://github.com/dokuwiki/dokuwiki/blob/stable/inc/Menu/AbstractMenu.php#L62

It's called by the UserMenu from your template. If you use the default
template, here:
https://github.com/dokuwiki/dokuwiki/blob/stable/lib/tpl/dokuwiki/tpl_header.php#L49

You can also add a button with the menu items assembly event
https://www.dokuwiki.org/devel:event:menu_items_assembly
But I'm not sure that this is the way to go.

Maybe someone with more experience on this topic can answer.

Good luck.


On Fri, 26 May 2023 at 16:45, Marc Franquesa <marc.franquesa@xxxxxxxxx>
wrote:

I am developing an authplugin merging code parts of authenvvars
(authentication via HTTP server REMOTE_USER) and login-redirector plugin
(to make the login button redirect to authportal).

My idea is to make any HTTP access unauthenticated, and require
authentication through HTTPS.

The plugin works fine as:

* If I authenticate thru the login portal, dokuwiki properly identifies
and get the user information and permissions
* If I login or logout via do=action I'm properly redirected and logged
in/out both on dokuwiki and the portal

However my problem is that Dokuwiki UI doesn't show the login button on
the web pages. However the do=login action works and the logout button and
action too. So is merely a UI issue: the login button is hidden for
unauthenticated (HTTP) users.

ACLs are enabled and users.auth.php and acl.auth.php are writable by the
web server. If I switch to any other authplugin (plain/LDAP) it also works
and shows the UI button to login, so my suspect is that dokuwiki decide to
disable the login button as my plugin implements trustExternal() (and
cando[external] is true).

I don't see either the code, examples or doc any cando['login'] reference
so I don't get what I miss in my code to make Dokuwiki show the login
button to the user.

Any clues/hints?

Other related posts: