-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All: Add SAML support #11865
base: dev
Are you sure you want to change the base?
All: Add SAML support #11865
Conversation
This is due to changes in the lib package caused by adding SAML support. Currently, the CLI does not support SAML auth, this only fixes regular Joplin Server sync.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Thanks for creating this pull request! At the moment it has some issues related to the linter, which you should be able to fix by running |
I fixed the issues related to the linter. However, the server image does not build since the XML schema validator ( |
Hmm, if it's just to validate an XML schema I guess it's not worth adding a Java dependency? From their doc it looks like there's a TypeScript package too? |
xsd-schema-validator is replaced with xmllint-wasm, to remove any dependency to another program
I got rid of the Java dependency, and replaced the schema validator with |
This PR adds SAML support to Joplin.
Server
Based on the
samlify
library that provides the SAML logic flow for Joplin Server.This adds the following environment variables used as configuration parameters to Joplin Server :
SAML_ENABLED
: If set totrue
, enables SAML support.DISABLE_BUILTIN_LOGIN_FLOW
: If set totrue
, all auth requests MUST go though SAML. Users can't log-in using Joplin-specific credentials and/or LDAP.SAML_IDP_CONFIG_FILE
: Should be a path to an XML file containing the metadata for the Identity Provider (IDP).SAML_SP_CONFIG_FILE
: Should be a path to an XML file containing the metadata for the Service Provider (SP, in this case Joplin).SAML_ORGANIZATION_DISPLAY_NAME
: Name of the organization, as shown on the log-in screen. Optional.The XML files are standard SAML IDP/SP metadata that should be created by the identity solution.
Clients
As for the clients themselves, no additional libraries are needed, since the actual log-in process is happening in a web browser, outside of Joplin itself.
It also adds a new sync target, based on the one for Joplin Server: "Joplin Server (Beta, SAML)". We kept "Beta" in the name for this since the main Joplin Server target itself is currently considered as such.
Important
The log-in flow uses a callback to a
joplin://
URL, and thus requires that only one instance of Joplin is running at any given time. This is important for the desktop client, since the single instance lock is not enforced in thedev
environment.Log-in flow
The log-in process differs slightly if started from within a client or within the server web interface.
Testing and development
For development purposes, we used
saml-idp
as the Identity Provider, as it allows to quickly create new users on the fly and is simple to set up. After generating the keypair (look at thesaml-idp
documentation to see how), just runningnpx saml-idp --acsUrl 'http://localhost:22300/api/saml' --audience http://localhost:22300 --issuer 'saml-idp'
is enough to get a test Identity Provider running, assuming that Joplin Server is running onlocalhost:22300
.Since
saml-idp
does not support generating SP metadata, here is a sample configuration for the Service Provider part :