Configure SAML SSO for Konnect with Microsoft Entra ID

Incompatible with
on-prem
Related Documentation
TL;DR

Get your Konnect organization ID from the /organizations/me endpoint, then create a non-gallery enterprise application in Microsoft Entra ID, configure the SAML settings with that organization ID and your chosen login path, and map the required user attributes and claims. Then create a SAML identity provider using the /identity-providers endpoint with the App Federation Metadata URL from Entra ID, and enable SAML using the /authentication-settings endpoint.

Prerequisites

If you don’t have a Konnect account, you can get started quickly with our onboarding wizard.

  1. The following Konnect items are required to complete this tutorial:
    • Personal access token (PAT): Create a new personal access token by opening the Konnect PAT page and selecting Generate Token.
  2. Set the personal access token as an environment variable:

    export KONNECT_TOKEN='YOUR KONNECT TOKEN'

You need a Microsoft Entra account with the Cloud Application Administrator or Application Administrator role.

You also need an Entra ID group containing the users you want to map to a Konnect team. If you don’t have one yet, create a group before continuing. Export the name of the Entra ID group you want to map to the team in Konnect:

export ENTRA_GROUP_NAME='YOUR-ENTRA-GROUP-NAME'

Create an enterprise application in Microsoft Entra ID:

  1. Sign in to the Microsoft Entra admin center using your admin account.
  2. In the sidebar, navigate to Entra ID > Enterprise apps.
  3. Click New application.
  4. Click Create your own application.
  5. Enter a name for the application (for example, Konnect SSO).
  6. Select Integrate any other application you don’t find in the gallery (Non-gallery).
  7. Click Create.

Konnect supports external single sign-on with SAML authentication using Microsoft Entra. This allows Org admins to log in with SSO and is an alternative to Konnect’s built-in authentication.

The following diagram shows the SAML authentication flow between a user, Konnect, and Microsoft Entra ID:

 
sequenceDiagram
    participant User
    participant Konnect as Konnect
    participant Entra as Entra ID (IdP)

    User->>Konnect: Access login URL (https://cloud.konghq.com/login/<custom_path>)
    Konnect->>User: Redirect to IdP SSO URL (https://login.microsoftonline.com/<tenant_id>/saml2)
    User->>Entra: Send SAML request (SP entity ID: https://cloud.konghq.com/sp/<organization_id>)
    Entra->>User: Return SAML response with claims (email, name ID, groups)
    User->>Konnect: Post SAML response to ACS URL (https://global.api.konghq.com/v2/authenticate/<custom_path>/saml/acs)
    Konnect->>Konnect: Validate SAML response (verify signature, claims)
    Konnect->>User: Grant access to Konnect
  

Get your organization ID

Before configuring Basic SAML in Entra ID, get and save your Konnect organization ID. You’ll need this to build the SAML values Entra ID expects. Send a GET request to the /organizations/me endpoint:

curl -X GET "https://global.api.konghq.com/v3/organizations/me" \
     --no-progress-meter --fail-with-body  \
     -H "Authorization: Bearer $KONNECT_TOKEN"

Also decide on the login path you want to use for your Konnect organization, and export it as an environment variable. This will be appended to the Konnect login, for example: https://cloud.konghq.com/login/$LOGIN_PATH You’ll use this same value in both Entra ID and Konnect:

export LOGIN_PATH='my-org'

Configure Basic SAML in Microsoft Entra

Configure SAML authentication for your Enterprise app in Entra:

  1. In the application, click Single sign-on in the sidebar.
  2. Select SAML as the single sign-on method.
  3. In the Basic SAML Configuration section, click Edit.
  4. In the Identifier (Entity ID) field, enter https://cloud.konghq.com/sp/$KONNECT_ORG_ID.
  5. In the Reply URL (Assertion Consumer Service URL) field, enter https://global.api.konghq.com/v2/authenticate/$LOGIN_PATH/saml/acs.
  6. In the Sign on URL field, enter https://cloud.konghq.com/login/$LOGIN_PATH.
  7. Click Save.
  8. In the sidebar, click Users and groups, then click Add user/group and assign the Entra ID group you want to map to a Konnect team.
  9. In the Attributes & Claims section, click Edit.
  10. Configure the following claims. For each claim, clear the namespace URI before saving:
    1. Set Unique user identifier to user.userprincipalname.
    2. Click Add a group claim, select Groups assigned to the application, and set the Source attribute to Cloud-only group display names so the SAML assertion sends the group’s name rather than its object ID. Then click Advanced options, select Customize the name of the group claim, and enter user.groups in the Name field.
    3. Click Add new claim and add a claim named firstname with source attribute user.givenname. Click Save.
    4. Click Add new claim and add a claim named lastname with source attribute user.surname. Click Save.
    5. Click Add new claim and add a claim named email with source attribute user.mail. Click Save.
  11. Navigate back to your SAML settings and copy the App Federation Metadata URL from the SAML Certificates section, and export it as an environment variable. You’ll need this in the next section:
    export APP_FEDERATION_METADATA_URL='YOUR-APP-FEDERATION-METADATA-URL'

Important: Use the App Federation Metadata URL, not the tenant-level metadata URL. Using the tenant-level URL causes an invalid SAML response error due to a certificate mismatch.

Configure SAML in Konnect

Create the SAML identity provider using the App Federation Metadata URL from Microsoft Entra ID and the login path you chose earlier, by sending a POST request to the /identity-providers endpoint. Konnect uses the login path to generate your organization’s custom login URL: https://cloud.konghq.com/login/$LOGIN_PATH.

Capture the identity provider’s ID as $IDP_ID:

IDP_ID=$(curl -X POST "https://global.api.konghq.com/v3/identity-providers" \
     --no-progress-meter --fail-with-body  \
     -H "Authorization: Bearer $KONNECT_TOKEN" \
     --json '{
       "type": "saml",
       "login_path": "'$LOGIN_PATH'",
       "config": {
         "idp_metadata_url": "'$APP_FEDERATION_METADATA_URL'"
       }
     }' | jq -r ".id"
)

Configure teams in Konnect

Before you can map teams from Entra, you must create them or modify the existing teams in Konnect.

  1. Create the Konnect team you want to map to an Entra ID group, and capture its ID as $TEAM_ID, by sending a POST request to the /teams endpoint. If you already have a team to map, send a GET request to the /teams endpoint instead, filtered on its name, to look up its ID:

    TEAM_ID=$(curl -X POST "https://global.api.konghq.com/v3/teams" \
         --no-progress-meter --fail-with-body  \
         -H "Authorization: Bearer $KONNECT_TOKEN" \
         --json '{
           "name": "IDM - Developers",
           "description": "The Identity Management (IDM) team."
         }' | jq -r ".id"
    )
  2. Map the Entra ID group to the team by sending a POST request to the /identity-providers/{idpId}/team-group-mappings endpoint:

    curl -X POST "https://global.api.konghq.com/v3/identity-providers/$IDP_ID/team-group-mappings" \
         --no-progress-meter --fail-with-body  \
         -H "Authorization: Bearer $KONNECT_TOKEN" \
         --json '{
           "team_id": "'$TEAM_ID'",
           "group": "'$ENTRA_GROUP_NAME'"
         }'

    The $ENTRA_GROUP_NAME is the name of the group in Entra that you exported in the prerequisites. Repeat this request for each additional team you want to map.

Enable SAML and team mappings in Konnect

  1. Enable SAML as an authentication method for your organization by sending a PATCH request to the /authentication-settings endpoint:

    curl -X PATCH "https://global.api.konghq.com/v3/authentication-settings" \
         --no-progress-meter --fail-with-body  \
         -H "Authorization: Bearer $KONNECT_TOKEN" \
         --json '{
           "saml_auth_enabled": true
         }'
  2. Team mappings let you automatically assign Konnect teams based on Entra ID group membership. Enable IdP mapping by sending a PATCH request to the /authentication-settings endpoint:

    curl -X PATCH "https://global.api.konghq.com/v3/authentication-settings" \
         --no-progress-meter --fail-with-body  \
         -H "Authorization: Bearer $KONNECT_TOKEN" \
         --json '{
           "idp_mapping_enabled": true
         }'

Validate

  1. Navigate to your custom login URL: https://cloud.konghq.com/login/$LOGIN_PATH. You will be redirected to the Microsoft Entra ID sign-in page.
  2. Log in with your Entra ID credentials. If the configuration is correct, you are authenticated into Konnect.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!