linux_server_manuals:dokuwiki_authentication_against_keycloak
This is an old revision of the document!
Dokuwiki authentication against Keycloak
plugin: oAuth
adding group mapping:
Mapper Type: “group membership”
Token Claim Name: “groups”
Full group paths: off
Add to id token: off
Add to access token: off
Add to userinfo: on
linux_server_manuals/dokuwiki_authentication_against_keycloak.1517412533.txt.gz · Last modified: 2018/01/31 15:28 by ronney
Discussion
Two additions:
to my local.php, it works just fine without enabling option to register
Hm, @Shuki's mapper didnt work for me. But using the one from the documentation doesn't seem to show me the users belonging to the groups in the Users admin page.
Hi,
i followed the instructions on this page and it still is not working.
i get the error:
Your (re)login has failed.
In the browser I get this return:
http://192.168.1.48:81/doku.php?error=invalid_request&error_description=Invalid+scopes%3A+
Could you guys help me with a fix?
Tnx!
It seems to be an issue with Keycloak 10.
https://github.com/cosmocode/dokuwiki-plugin-oauth/issues/89
I will try the fix mentioned by YoitoFes on Github:
I modified Keycloak service's scripts as follows by imitating an other service's one and login works well.
— phpoauthlib/src/OAuth/OAuth2/Service/Keycloak.php.bak
+++ phpoauthlib/src/OAuth/OAuth2/Service/Keycloak.php
— classes/KeycloakAdapter.php.bak
+++ classes/KeycloakAdapter.php
Since I'm not familiar with OAuth2 protocol and the implementation of this plugin, I'm not sure this modification is correct.
I tested this and login with Keycloak is now working for me!
I had the same symptoms, so I implemented to my local DokuWiki php files the 2 code changes specified above. After that everything works.
Note that the 'groups' membership data in the original post is what worked for me, not that in the first comment by Shuki.
The pull request mentioned was merged on 26/05/2020, but I'm not sure how long that will take to reach downstream implementations (such as Turnkey, like I use). In the meantime the code change is relatively easy to make oneself.
Does anyone know is it possible to use Keycloak user attributes on DokuWiki with oAuth? Can I pass some other attributes in similar way as groups mapper?
The problem is that we have customer numbers stored in keycloak user attributes and now wondering how to get those to Dokuwki iframe urls.