# CryptPad SSO Plugin The CryptPad SSO plugin can be manually installed to allow a CryptPad instance to be connected to a single sign-on (SSO) system. This allows to restrict registrations to only SSO users or to display a “Register with SSONAME” button on the connection and registration screen. Users will still be able to create a personal password which will be used to derive the “encryption key” of their drive secret from SSO Administrators. ## Features supported - OIDC and SAML SSO connectors; - Allow logging in using one or more SSO systems; - Allow restricting login to only SSO; - Store public key information of SSO users on the CryptPad server. ## Features not supported / Future Work - Store extra information from users coming from SSO; - Allow sharing documents with SSO users without the need to connect with them; - Allow administrators to manage SSO users (see their storage use, delete their data, etc.); - Allow synchronizing OIDC roles/groups with CryptPad teams; - Additional SSO protocols. If you are interested in these extra features and wish to sponsor them, contact XWiki SAS at sales@cryptpad.org ## Manual installation 1. Go the cryptpad/lib/plugins directory on your server ``` cd cryptpad/lib/plugins git clone https://github.com/cryptpad/sso/ npm ci ``` 2. Edit the SSO configuration on the CryptPad admin UI 3. Restart the CryptPad server ## Create an OpenID Connect Configuration on your authentication server The SSO module has been successfully tested using KeyCloak and Univention UCS using default settings. When setting up the client credentials on your OpenIDC Connect server the following redirect URI needs to be set `https:///ssoauth` (In case you are still using a local test http server the URL should be `http://:/ssoauth`) ## (DEPRECATED) sso.js sample configurations Here follows an example configuration file for `sso.js` showing examples for KeyCloak, Univention UCS and SAML: ``` // SPDX-FileCopyrightText: 2023 XWiki CryptPad Team and contributors // // SPDX-License-Identifier: AGPL-3.0-or-later //const fs = require('node:fs'); module.exports = { // Enable SSO login on this instance enabled: true, // Block registration for non-SSO users on this instance enforced: false, // Allow users to add an additional CryptPad password to their SSO account cpPassword: true, // You can also force your SSO users to add a CryptPad password forceCpPassword: true, // List of SSO providers list: [ { name: 'keycloak', type: 'oidc', url: 'https://', client_id: "cryptpad", client_secret: "", jwt_alg: 'RS256', (deprecated) id_token_alg: 'PS256', (optional) userinfo_token_alg: 'PS256', (optional) username_scope: 'profile', (optional) username_claim: 'name', (optional) use_pkce: true, (optional) use_nonce: true (optional) }, /* // Sample Univention UCS Configuration (using Kopano Connect) { name: 'xwiki', type: 'oidc', url: 'https://ucs-sso.', client_id: "cryptpad", client_secret: "