Skip to content
  • Auth and access
  • Enterprise connections

Custom authentication with SAML

In Kinde, you can use SAML as your authentication protocol. Kinde acts as a service provider (SP), so you still need to bring your own identity provider (IdP) to set it up. Identity providers can include Google, Microsoft Azure, Cloudflare, and others.

Note: Since there are differences between set ups for each IdP, we are unable to provide full details on how to configure them all to connect with Kinde. However, the fields we mention below, should have similar names in your IdP.

Before you set up SAML

Link to this section

Users must already exist in Kinde for SAML sign in to work. Users must also have the same email domain as the home realm domains you define.

You can import users in bulk or add them manually to Kinde.

(Optional) Signed certificate and private key

Link to this section

You can increase SAML security by adding a certificate and private key pair to your setup. Your IdP will check that the certificate and private key matches, each time a user authenticates this way.

You can obtain the certificate and key from your IdP or you can generate yourself, see below.

Generate a certificate and private key pair

Link to this section
  1. In your preferred system, run a command to generate a certificate and key. For example, on *nix systems, the command is: openssl req -x509 -nodes -sha256 -days 3650 -newkey rsa:2048 -keyout private_key.key -out certificate.crt.
  2. This command may also work in other systems, such as WSL on Windows. Alternatively, you can try installing openssl binaries for your system.
  3. Once the files are generated, save them locally.
  4. Add the certificate to your IdP settings. The certificate there and the one in Kinde must match exactly. Instructions for how to do this varies, depending on your IdP.
  5. Copy the certificate and private key details into Kinde as per the procedure below.

Set up SAML in Kinde

Link to this section
  1. In Kinde, go to Settings > Authentication.
  2. Scroll down to the Enterprise connections area and select Add connections.
  3. In the window that opens, select the SAML option and then Save. The SAML tile now appears as a connection.
  4. Select Configure on the SAML tile. The configuration dialog opens. The information you enter here, needs to exactly match the information in your identity provider settings.
  1. Enter a name for the connection. It must match the name in your SAML setup.
  2. Enter an Entity ID. This is a value you can make up using a random alphanumeric string, e.g. 5836g209gbhw09r8y0913. The Entity ID you enter here must be configured exactly the same in your identity provider (unless your IdP is Microsoft Azure).
  3. If your identity provider is Microsoft Azure, add spn: to the beginning of the Entity ID string in Kinde, e.g. spn:5836g209gbhw09r8y0913.
  4. Enter the IdP metadata URL. This URL comes from your identity provider.
  5. Enter an Email key attribute. This is the attribute in the SAML token that contains the user’s email. Setting this value ensures that the email address returned in the SAML response is correctly retrieved. We do not recommend leaving this field blank, but if you do we will set ‘email’ as the attribute.
  6. Enter any relevant Home realm domains. This is how SAML recognizes a user’s credentials and routes them to the correct sign in page. Note that home realm domains need to be unique across all connections in an environment. Read more about home realm domains.
  7. Copy the ACS URL, which is also known as a reply URL. This will need to be copied to the relevant area of your identity provider configuration.
  1. Select whether you want to automatically Create a user record in Kinde for new users. This can save time adding them manually or via API later.
  2. (Optional) In the Sign SAML request section, paste in the Signed certificate and Private key. You may have got these from your IdP or you may have generated yourself (see procedure above).
  3. Choose which applications you want to enable SAML for and select Save.
  4. Complete any additional configuration in your identity provider’s settings, such as adding the Entity ID and ACS URL.

Test the connection

Link to this section

Once you have entered the ACS URL in your identity provider, the connection should be enabled.

  1. Go to your test application and attempt to sign in.
  2. If you left the Home realm domains field blank in Kinde, when you launch your application, you should see a button to sign in. Click it and go to step 4.
  3. If you completed the Home realm domains field, you should be redirected immediately to your IdP sign in screen.
  4. Enter your IdP details and complete any additional authentication required.

Delete a SAML connection

Link to this section

⚠️ Before you delete a connection, make sure that there are no users relying on it for authentication. Once deleted, the sign in option becomes unavailable to users. This action can’t be reversed.

  1. In Kinde, go to Settings > Environment > Authentication.
  2. Scroll down to the Enterprise connections section and select the three dots on the tile for the connection, then select Delete connection.
  3. In the confirmation window, select Delete connection.