Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Using Keycloak instead of Picketlink for SAML-based authentication

August 27, 2019
Siddhartha De
Related topics:
Security
Related products:
Red Hat JBoss Enterprise Application Platform

Share:

    The Picketlink project is now a deprecated module in Red Hat JBoss Enterprise Application Platform (EAP), so there's a chance that Picketlink will no longer ship with the next release of EAP/Wildfly and that there will not be any fixes in the near future for the picketlink module.

    Picketlink, however, is now merged with Keycloak, an open source identity and access management solution developed by Red Hat's JBoss Community. In this article, we'll present an alternative solution to the picketlink module. Some organizations use picketlink as the service provider to enable SAML-based authentication with a third-party identity provider (i.e., Active Directory Federated Services (AD FS), OKTA, PingFederate, etc.). In this, article, we'll see how the keycloak-saml adapter can be configured in the place of Picketlink to enable SAML-based authentication with a third-party identity provider.

    Set up the Relying Party

    In AD FS Management console, right-click Trust relationships → Relying Party Trusts and select Add Relying Party Trust from the menu:

    AD FS allows you to import metadata, which completes the configuration without any manual intervention. However, here we are required to go with manual configuration.

    Select AD FS profile for SAML2.0 based federation:

    If you are required to enable encrypted assertion, import the certificate that will be used for encryption, but make sure that the associated private key is present with the service provider.

    Check the SAML2.0 WebSSO protocol support to enable SAML federation with a web application:

    Add the URL of the relying party trust; multiple URLs can be added here:

    Permit all users to enable access for all the user to the relying-party:

    Once the relying party trust is added, AD FS will be able to correctly authenticate the users according to requests from the service provider, but the requested name ID format will not yet be recognized and the SAML response will not contain any additional information like email. Thus, it's necessary to map claims from AD user details into a SAML document.

    Three rules

    We will set up three rules: one for mapping user ID, one for mapping standard user attributes, and another for a user group. All of these start by clicking the Add Rule button in the Edit Claim Rules.

    The first rule will map the user ID in Windows Qualified Domain name to the SAML response. In the Add Transform Claim Rule window, select Transform an incoming claim rule type:

    The example above targets the Windows account name ID format. Other name ID formats are supported but are outside the scope of this post. See this article on how to set up name IDs for persistent and transient formats.

    The second rule will map the user email to the SAML response. In the Add Transform Claim Rule window, select Send LDAP attributes as Claims rule type. You can add other attributes as needed:

    The third rule would send a group name if the user is a member of a named group. Again, start in the Add Transform Claim Rule window and select Send Group Membership as a Claim rule type. Then enter the requested values in the field:

    This setup would send an attribute named Group in the SAML assertion with value managers if the authenticated user is a member of the DOMAIN\Managers group.
     
    Now install keycloak-saml-adapter in Wildfly,
    • Download the Wildfly client adapter from https://www.keycloak.org/downloads.html.
    • Unzip the saml-adapter at $Wildfly_Home. In Linux, unzip can be done by executing the command unzip keycloak-wildfly-adapter-dist.zip.
    • Post successful extraction a CLI script. adapter-install-saml.cli will be present at $Wildfly_Home/bin, which is required to be executed through the jboss-cli command, i.e., $Wildfly_Home/bin/jboss-cli.sh --connect --file=adapter-install-saml.cli.

    Wildfly is now ready with keycloak-saml adapter. To enable authentication with AD FS through SAML protocol, the keycloak-saml.xml file must be configured similarly to the picketlink.xml, as shown below, and placed at application's WEB-INF.

    <keycloak-saml-adapter xmlns="urn:keycloak:saml:adapter" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="urn:keycloak:saml:adapter 
                   http://www.keycloak.org/schema/keycloak_saml_adapter_1_7.xsd">
          <SP entityID="https://example.com:8443/saml-servlet-filter/" sslPolicy="EXTERNAL"
               nameIDPolicyFormat="urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName"
               logoutPage="/logout.jsp">
               <IDP entityID="idp" signatureAlgorithm="RSA_SHA256">
                    <SingleSignOnService signRequest="false"
                            validateResponseSignature="false"
                            requestBinding="POST"
                            bindingUrl="https://example.adfs.com/adfs/ls/"/>
                    <SingleLogoutService signRequest="false"
                            signResponse="false"
                            validateRequestSignature="false"
                            validateResponseSignature="false"
                            requestBinding="POST"
                            responseBinding="POST"
                            postBindingUrl="https://example.adfs.com/adfs/ls/"
                            redirectBindingUrl="https://example.adfs.com/adfs/ls/"/>
              </IDP>
          </SP>
    </keycloak-saml-adapter>

    That's it. Now the keycloak-saml adapter is set up and ready to go.

    Last updated: June 12, 2023

    Recent Posts

    • Why some agentic AI developers are moving code from Python to Rust

    • Confidential VMs: The core of confidential containers

    • Benchmarking with GuideLLM in air-gapped OpenShift clusters

    • Run Qwen3-Next on vLLM with Red Hat AI: A step-by-step guide

    • How to implement observability with Python and Llama Stack

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue