Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:2.0:single_sign_on:saml_dokuwiki [2026/09/04 12:23] – [TL;DR; - Quick Overview] kainhoferen:2.0:single_sign_on:saml_dokuwiki [2026/09/09 19:19] (current) – [Prerequisites] kainhofer
Line 8: Line 8:
    
  
-As a first step, one needs to **configure Admidio to act as an SAML 2.0 Identity Provider** (IdP). This has to be done once and is not specific to DokuWiki. Please follow this guide: [[en:2.0:single_sign_on|#a_basic_setup_for_admidio_as_a_saml_id_provider]]+As a first step, one needs to **configure Admidio to act as an SAML 2.0 Identity Provider** (IdP). This has to be done once and is not specific to DokuWiki. Please  [[en:2.0:single_sign_on#a_basic_setup_for_admidio_as_a_saml_id_provider|follow this guide]].
 {{ :en:2.0:sso:sso_saml_01-05_setup_admidio_preferences.png?direct&600 |}} {{ :en:2.0:sso:sso_saml_01-05_setup_admidio_preferences.png?direct&600 |}}
  
Line 60: Line 60:
  
 {{ :en:2.0:sso:sso_saml_04-05_dw_admidio_clientsetup1.png?direct&400 |}} {{ :en:2.0:sso:sso_saml_04-05_dw_admidio_clientsetup1.png?direct&400 |}}
 +{{ :en:2.0:sso:sso_saml_04-05_dw_admidio_clientsetup1b.png?direct&400 |}}
  
-In addition to the Entity ID and URLs to connect SP and IdP and the certificate, which are configured automatically, one also needs to define the attribute and role mapping. The username is the most relevant. To use Admidio's group memberships as Dokuwiki groups, make sure to include the "Roles" field and provide the correct field name in Dokuwiki.  +In addition to the Entity ID and URLs to connect SP and IdP and the certificate, which are configured automatically, one also needs to define the attribute and role mapping. Both Admidio and Dokuwiki allow configuring the attribute used as login name and groups, so the actual attribute name is not important, but Dokuwiki and Admidio must be configured to use the same name (circled in the image). To use Admidio's group memberships as Dokuwiki groups, make sure to include the "Roles" profile field and map the included groups to SAML (=Dokuwikiroles
- +
-Make sure to use the same SAML field names as the ones mapped in Dokuwiki's Saml configuration (circled red in the configuration screenshot above).+
  
 {{ :en:2.0:sso:sso_saml_04-06_dw_admidio_clientsetup2.png?direct&400 |}} {{ :en:2.0:sso:sso_saml_04-06_dw_admidio_clientsetup2.png?direct&400 |}}
  
  
-The plugin also provides settings to define whether signatures are expected or not. Choose whichever security level is desiredbut make sure that the settings in DokuWiki and in Admiodio are consistent: +Dokuwiki does not support signing its messages to admidioso the corresponding settings in Admidio are not applicable.
-{{ :en:2.0:sso:sso_saml_02-07_nc_admidio_clientsetup3.png?direct&600 |}}+
  
 Once all settings are done, it is time to enable the saml plugin for login to DokuWiki in the "Configuration Settings":  Once all settings are done, it is time to enable the saml plugin for login to DokuWiki in the "Configuration Settings": 
Line 85: Line 83:
 $conf['plugin']['saml']['endpoint'] = 'https://admidio.local/modules/sso/index.php/saml/sso'; $conf['plugin']['saml']['endpoint'] = 'https://admidio.local/modules/sso/index.php/saml/sso';
 $conf['plugin']['saml']['slo_endpoint'] = 'https://admidio.local/modules/sso/index.php/saml/slo'; $conf['plugin']['saml']['slo_endpoint'] = 'https://admidio.local/modules/sso/index.php/saml/slo';
-$conf['plugin']['saml']['certificate'] = 'MIIEF.........vlhuSLY';+$conf['plugin']['saml']['certificate'] = '-----BEGIN CERTIFICATE----- 
 +MIID4DCCAsigAwIBAgIBADANBg...nS+ViEoHuI2FSMyLpVB5 
 +-----END CERTIFICATE-----';
 $conf['plugin']['saml']['use_slo'] = 1; $conf['plugin']['saml']['use_slo'] = 1;
 </code> </code>
Line 101: Line 101:
 ==== Caveats and Things to Consider ==== ==== Caveats and Things to Consider ====
  
-  * Dokuwiki is picky about signatures. If a SAML response is not signed, login will not be possible, but no corresponding error message will be shown. After an apparent login, the user will arrive at dokuwiki with no user logged in (actually, DokuWiki even silently triggers a logout!). Make sure that in Admidio's client setting for the Dokuwiki SAML client the checkbox "Sign assertions sent to the client (SP)" is checked!+  * Dokuwiki is **picky about signatures**. If a SAML response is not signed, login will not be possible, but no corresponding error message will be shown. After an apparent login, the user will arrive at dokuwiki with no user logged in (actually, DokuWiki even silently triggers a logout!). Make sure that in Admidio's client setting for the Dokuwiki SAML client the checkbox "Also sign SAML responses" is checked! 
 +  * DokuWiki's **single log out mechanism for SAML is broken**:  
 +    * Instead of the logged-in user, DokuWiki sends its own client ID, so Admidio never knows, which user is supposed to be logged out. Only the browser session ID is available. As a workaround, Admidio looks up all logged-in users attached to that browser session and performs a single-log-out on them. 
 +    * Single-Log initiated from another SAML client does not log out DokuWiki. Dokuwiki's SAML plugin just clears its login, but misses the relevant cookie, so the next reload will appear logged-in in dokuwiki again locally. 
 +    * Bug reports have been filed for DokuWiki's SAML plugin, including the necessary fixes: Issue [[https://github.com/takuy/dokuwiki-plugin-saml/issues/8|#8]], [[https://github.com/takuy/dokuwiki-plugin-saml/issues/9|#9]] and [[https://github.com/takuy/dokuwiki-plugin-saml/issues/10|#10]] 
 +    * With the three simple patches proposed in the bug reports, single-log-out works properly.
  
  • en/2.0/single_sign_on/saml_dokuwiki.1788517382.txt.gz
  • Last modified: 2026/09/04 12:23
  • by kainhofer