Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Engineering
  4. Configure SAML 2.0 Single Sign-on with Kong Enterprise
Engineering
December 9, 2022
5 min read

Configure SAML 2.0 Single Sign-on with Kong Enterprise

Steve Young
Topics
API DesignKong Gateway Enterprise
Share on Social

More on this topic

Videos

Service Catalog with Traceable AI

Videos

Unlock Microservices Mastery: OpenTelemetry in Kong Gateway

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo

What is SAML?

Security Assertion Markup Language (SAML) is an XML-based open standard that allows organizations to set up single sign-on (SSO) across multiple websites and applications. SAML 2.0 is the latest standard, and was ratified in March 2005, replacing SAML 1.1. We’ll refer to SAML as meaning SAML 2.0 for the remainder of this document.

SAML is mostly used as a web-based authentication mechanism as it relies on using the browser to broker the authentication flow. The SAML specification defines three roles:

  • A Principal (or End User)
    • Almost always a human user who is attempting to access a resource using a Browser
  • An Identity Provider (IdP)
    • A service that performs the authentication, by checking usernames and passwords, verifying account status, invoking multi-factor authentication (MFA), etc.
  • A Service Provider (SP)
    • Provides services to the end user. Relies of the IdP to assert the identity of a user

SP-initiated SSO with SAML Authentication

The Kong Enterprise SAML implementation supports the SP initiated SSO flow. This flow starts when a user tries to access a resource on the SP. If the SP detects the user doesn’t have a browser session active, it will redirect them to the IdP asking for the authentication request. The IdP will authenticate the user, and if successful, create the SAML assertion and redirect the user back to the SP.

XML messages are not exchanged directly between the IdP and SP, but via the Browser. This is described in the following sequence diagram:

alt_text

  1. Kong Enterprise initiates SSO when a user tries to access a protected Upstream Service
  2. Kong Enterprise detects if the user has an active browser session. If no session exists, Kong Enterprise creates an SAML Request, also known as an authentication request. The request can be digitally signed
  3. The User’s Browser relays the SAML authentication request to the IdP
  4. A SAML Response is generated by the IdP. This response contains the assertion of the authenticated user. This response is digitally signed and optionally encrypted.
  5. The SAML Assertion is relayed to Kong Enterprise
  6. Kong Enterprise verifies the SAML Response, and either accepts or rejects the initial request to access the Upstream Service

Advantages of SAML

SAML 2.0 is widely adopted by enterprises, for several reasons:

  • Improves the user experience, because SAML provides the ability for users to securely access multiple applications with a single set of credentials entered once
  • Reduces the risk of weak passwords because users only have one password for all systems
  • Moves the responsibility for authentication & management to the IdP, which has the ability to invest in multiple layers of security such as multi-factor authentication (MFA), session management, & user sign-on/off processes (e.g. when an employee leaves a company)
  • Reduces IT help desk costs, because users have less access issues and need less help resetting passwords

Kong SAML Plugin Configuration Options

The Kong Enterprise SAML implementation is provided using the Kong SAML plugin, which is available in Kong Enterprise v3.1+. Kong Plugins provide advanced functionality and extend the use of Kong Enterprise. Refer to the Kong Documentation Plugin Overview for more information on Kong Plugins.

The minimum configuration for the Kong SAML plugin is detailed below:

  • An IdP certificate
    • The SP needs to obtain the public certificate from the IdP to validate the signature in a SAML response. The certificate is stored on the SP and is to verify that a response is coming from the IdP
  • ACS Endpoint
    • This is the endpoint provided by the SP where SAML responses are sent. The SP needs to provide this information to the IdP
  • IdP Sign-in URL
    • This is the IdP Sign-in endpoint where the Kong SAML plugin will issue authentication requests. The SP needs to obtain this information from the IdP
  • Issuer
    • The unique identifier of the IdP application

At the time of writing this document, this plugin supports Microsoft Azure Active Directory as the SAML IdP. Please refer to the Microsoft AzureAD SAML documentation for more information about SAML authentication with Azure Active Directory.

Now let’s walk through adding SAML Authentication to a Service in Kong Enterprise using Microsoft Azure AD as the SAML IdP:

  1. Set-up a SAML Enterprise Application in Microsoft AzureAD:

    1. Create a SAML Enterprise Application. Refer to the Microsoft AzureAD documentation for more information
    2. From the Manage section of the Enterprise application in AzureAD, select “Single sign-on” and note the Identifier (Entity ID) and Login URL parameters alt_text
    3. In the “Basic SAML Configuration” tab displayed above, configure the “Reply URL (Assertion Consumer Service URL)”, for example, https://<your Kong Enterprise IP address here>:8443/aad/consume
    4. From the Manage section of Azure AD Enterprise application, select “Users and groups”, and assign users who will be able to login via SAML SSO
  2. Create an Anonymous Kong Consumer

    This permits anonymous Kong Consumer access via SAML Authentication to the Service we will configure in the next step. The anonymous consumer is configured in the SAML plugin

  1. Create a Service
  1. Create a Route
  1. Configure the SAML plugin on the Service

Replace the <AzureAD_Identity_ID>, <AzureAD_Sign_on_URL> and <AzureAD_Certificate> placeholders with the values identified in the previous steps

  1. Finally, using a Browser, go to the proxy url exposed by Kong Enterprise “https://:8443/aad”. Since the user is not authenticated, they will be redirected for authentication to Azure AD

alt_text

Once successfully logged in, Kong Enterprise will allow access to the configured Service.

Conclusion

SAML is a complex XML-based protocol, and in modern terms it is considered legacy compared to the more modern OAuth 2.0 and OpenID Connect protocols. That said, SAML isn’t going away anytime soon; SAML is a widely adopted enterprise solution. For that reason Kong have invested in developing the SAML plugin, and will expand functionality and support for other SAML IdPs in the future.

Topics
API DesignKong Gateway Enterprise
Share on Social
Steve Young

Recommended posts

Kong Gateway Enterprise 3.8.x.x EOL

Kong Logo
Product ReleasesSeptember 23, 2025

As of September 2025, Kong Gateway Enterprise 3.8 will enter its End Of Life (EOL) phase and will no longer be fully supported by Kong. Following this, Kong Gateway Enterprise 3.8 will enter a 12-month sunset support period, focused on helping cus

Andrew Jessup

Unlocking API Analytics for Product Managers

Kong Logo
EngineeringSeptember 9, 2025

Meet Emily. She’s an API product manager at ACME, Inc., an ecommerce company that runs on dozens of APIs. One morning, her team lead asks a simple question: “Who’s our top API consumer, and which of your APIs are causing the most issues right now?”

Christian Heidenreich

How to Build a Multi-LLM AI Agent with Kong AI Gateway and LangGraph

Kong Logo
EngineeringJuly 31, 2025

In the last two parts of this series, we discussed How to Strengthen a ReAct AI Agent with Kong AI Gateway and How to Build a Single-LLM AI Agent with Kong AI Gateway and LangGraph . In this third and final part, we're going to evolve the AI Agen

Claudio Acquaviva

How to Build a Single LLM AI Agent with Kong AI Gateway and LangGraph

Kong Logo
EngineeringJuly 24, 2025

In my previous post, we discussed how we can implement a basic AI Agent with Kong AI Gateway. In part two of this series, we're going to review LangGraph fundamentals, rewrite the AI Agent and explore how Kong AI Gateway can be used to protect an LLM

Claudio Acquaviva

How to Strengthen a ReAct AI Agent with Kong AI Gateway

Kong Logo
EngineeringJuly 15, 2025

This is part one of a series exploring how Kong AI Gateway can be used in an AI Agent development with LangGraph. The series comprises three parts: Basic ReAct AI Agent with Kong AI Gateway Single LLM ReAct AI Agent with Kong AI Gateway and LangGr

Claudio Acquaviva

Kong Gateway Enterprise 3.11 Makes APIs & Event Streams More Powerful

Kong Logo
Product ReleasesJuly 9, 2025

Update Includes Data Orchestration, CyberArk Support, Solace Integration, and Kafka Schema Validation We’re excited to bring you Kong Gateway Enterprise 3.11 with compelling new features to make your APIs and event streams even more powerful, includ

Anthony Gatti

Build Your Own Internal RAG Agent with Kong AI Gateway

Kong Logo
EngineeringJuly 9, 2025

What Is RAG, and Why Should You Use It? RAG (Retrieval-Augmented Generation) is not a new concept in AI, and unsurprisingly, when talking to companies, everyone seems to have their own interpretation of how to implement it. So, let’s start with a r

Antoine Jacquemin

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

Increase developer productivity, security, and performance at scale with the unified platform for API management, AI gateways, service mesh, and ingress controller.

Sign up for Kong newsletter

Platform
Kong KonnectKong GatewayKong AI GatewayKong InsomniaDeveloper PortalGateway ManagerCloud GatewayGet a Demo
Explore More
Open Banking API SolutionsAPI Governance SolutionsIstio API Gateway IntegrationKubernetes API ManagementAPI Gateway: Build vs BuyKong vs PostmanKong vs MuleSoftKong vs Apigee
Documentation
Kong Konnect DocsKong Gateway DocsKong Mesh DocsKong AI GatewayKong Insomnia DocsKong Plugin Hub
Open Source
Kong GatewayKumaInsomniaKong Community
Company
About KongCustomersCareersPressEventsContactPricing
  • Terms•
  • Privacy•
  • Trust and Compliance•
  • © Kong Inc. 2025