SAML support
Para can act as a SAML service provider and connect to a specified identity provider (IDP). The implementation uses OneLogin’s SAML Java Toolkit. Here’s a summary of all the steps required to authenticate users with SAML:
- Generate a X509 certificate and private key for your SP
- Convert the private key to PKCS#8 and Base64-encode both public and private keys
- Specify the metadata URL for your IDP in your config file
- Register Para with your IDP as trusted SP by copying the metadata from
/saml_metadata/{appid} - Send users to
/saml_auth/{appid}and Para will take care of the rest
The SP metadata endpoint is /saml_metadata/{appid} where appid is the app id for your Para app. For example, if your
Para endpoint is paraio.com and your appid is myapp, then the metadata is available at
https://paraio.com/saml_metadata/myapp as an XML file.
SAML authentication is initiated by sending users to the Para SAML authentication endpoint /saml_auth/{appid}.
For example, if your Para endpoint is paraio.com and your appid is myapp, then the user should be sent to
https://paraio.com/saml_auth/myapp. Para (the service provider) will handle the request and redirect to the SAML IDP.
Finally, upon successful authentication, the user is redirected back to https://paraio.com/saml_auth/myapp which is
also the assertion consumer service (ACS).
There are lots of configuration options but Para needs only a few of those in order to successfully authenticate with your SAML IDP (listed in the first rows below).
| Property | Default value | Description |
|---|---|---|
para.security.saml.sp.entityid | blank | The SP entityId, a URL in the form of https://paraio.com/saml_auth/{appid}. |
para.security.saml.sp.assertion_consumer_service.url | blank | The URL where users will be redirected back to, from the IDP. Same value as the entityId above. |
para.security.saml.sp.nameidformat | blank | Specifies constraints on the name identifier to be used to represent the requested subject. |
para.security.saml.sp.x509cert | blank | The X509 certificate for the SP, encoded as Base64. |
para.security.saml.sp.privatekey | blank | The private key for the X509 certificate, in PKCS#8 format, encoded as Base64. |
para.security.saml.idp.entityid | blank | The IDP entityId, a URL in the form of https://idphost/idp/metadata.xml |
para.security.saml.idp.single_sign_on_service.url | blank | SSO endpoint URL of the IdP. |
para.security.saml.idp.x509cert | blank | The x509 certificate for the IDP, encoded as Base64. |
para.security.saml.idp.metadata_url | blank | The location of IDP’s metadata document. Para will fetch it and the IDP will be auto-configured. |
para.security.saml.security.authnrequest_signed | false | Enables/disables signing of auth requests to the IDP. |
para.security.saml.security.want_messages_signed | false | Enables/disables signing of messages to the IDP. |
para.security.saml.security.want_assertions_signed | false | Enables/disables the requirement for signed assertions. |
para.security.saml.security.want_assertions_encrypted | false | Enables/disables the requirement for encrypted assertions. |
para.security.saml.security.want_nameid_encrypted | false | Enables/disables the requirement for encrypted nameId |
para.security.saml.security.sign_metadata | false | Enables/disables signing of SP’s metadata. |
para.security.saml.security.want_xml_validation | true | Enables/disables XML validation by the SP. |
para.security.saml.security.signature_algorithm | blank | Algorithm that the SP will use in the signing process. |
para.security.saml.attributes.id | blank | Mapping key for the id attribute. |
para.security.saml.attributes.picture | blank | Mapping key for the picture attribute. |
para.security.saml.attributes.email | blank | Mapping key for the email attribute. |
para.security.saml.attributes.name | blank | Mapping key for the name attribute. If this is set, the values for attributes firstname and lastname below will be ignored. |
para.security.saml.attributes.firstname | blank | Mapping key for the firstname attribute. |
para.security.saml.attributes.lastname | blank | Mapping key for the lastname attribute. |
para.security.saml.domain | blank | Domain name for users who don’t have a valid email. |
As a bare minimum, you should have the following SAML configuration:
# minimal setup# IDP metadata URL, e.g. https://idphost/idp/shibbolethpara.security.saml.idp.metadata_url = ""
# SP endpoint, e.g. https://paraio.com/saml_auth/myapppara.security.saml.sp.entityid = ""
# SP public key as Base64(x509 certificate)para.security.saml.sp.x509cert = ""
# SP private key as Base64(PKCS#8 key)para.security.saml.sp.privatekey = ""
# attribute mappings (usually required)# e.g. urn:oid:0.9.2342.19200300.100.1.1para.security.saml.attributes.id = ""# e.g. urn:oid:0.9.2342.19200300.100.1.3para.security.saml.attributes.email = ""# e.g. urn:oid:2.5.4.3para.security.saml.attributes.name = ""You want to either configure para.security.saml.attributes.name or para.security.saml.attributes.firstname, but not both.
You can also configure the SAML authentication filter through the app settings API:
{ "security.saml.sp.entityid": "https://paraio.com/saml_auth/myapp", "security.saml.idp.metadata_url": "https://idphost/idp/shibboleth", "security.saml.sp.x509cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0...", "security.saml.sp.privatekey": "LS0tLS1CRUdJTiBQUklWQVRF...", ... "signin_success": "http://success.url", "signin_failure": "http://failure.url"}Para can return a short-lived ID token back to the client which initiated the request. Add jwt=id to your
signin_success url. For example { "signin_success": "http://success.url?jwt=id" }. The id value of the parameter
will be replaced with the actual JWT ID token, which you can use to call paraClient.signIn("passwordless", idToken) to
get the long-lived session token.
You can also put all of the settings above in a configuration file, but this only works if your app is the root app (see the config).