User Community Service Desk Downloads
If you can't find the product or version you're looking for, visit

Keycloak Active Directory Integration

Use the following instructions to enable basic Single Sign-on via Keycloak with Azure Active Directory (AAD) as the identity provider using SAML.

In this article, we only cover authentication. In this case, when a user logs in to Ataccama for the first time, a user record is created in Keycloak with the user email address (as their username) and their first and last names, for use within Ataccama ONE.

These instructions assume that you have a fully-qualified-domain-name (FQDN) associated with the Ataccama Platform, which typically points to the gateway server’s or load balancer’s IP address.

Prepare Keycloak realm for integration with AD

  1. Log in to the Keycloak Administration Console.

  2. Open Ataccamaone realm in Keycloak.

  3. Go to the Identity Providers.

  4. From the dropdown list select SAML v2.0.

    Identity providers - SAML
  5. On the Add identity provider screen that opens, set up the Alias to 'saml'. This alias will be used in the redirect URL.

    You can also add a Display Name which will be visible on the Ataccama Login page.

  6. Make a note of the Redirect URI as it will be required later. Redirect URI should look something like https://<ataccama_platform_fqdn>/auth/realms/ataccamaone/broker/saml/endpoint, where saml matches the value of the Alias field.

  7. Leave this window open as we will return to it later.

Your organization’s identity and access management team might require further information, as shown in the following example.

Client information

The following responses (or similar) can be provided:

  • Identifier / Entity ID: https://<ataccama_platform_fqdn>/auth/realms/ataccamaone.

  • User Identifier: The AD attribute you want to use as the login and identifier, for example, username on the client’s side.

  • Reply (ACS) URL (from the previous steps): https://<ataccama_platform_fqdn>/auth/realms/ataccamaone/broker/saml/endpoint.

  • Sign On URL: <leave blank>.

  • Relay State: <leave blank>.

After supplying this information to your IAM team, they should be able to create an XML file with the Identity Provider metadata. You will need this to complete the Keycloak realm integration.

Keycloak realm integration (continued)

Return to the open Keycloak Add Identity Provider page, and follow these steps:

  1. Find the Import External IDP Config section at the bottom of the screen and paste the copied metadata link into the Import from URL field.

  2. Select Import. If the format of the file is correct, you should receive:

    Import successful

    The Single Sign-On Service URL is now populated. Other settings might have been changed too.

  3. Select Save.

Set up the first login flow

The First Login Flow is the process that is executed when a user logs in to Ataccama for the first time. In the scenario described here, a user record is created in Keycloak with the user email address as their username along with their first and last names, for use within Ataccama ONE.

  1. Log in to the Keycloak Administration Console.

  2. Ensure the Ataccamaone realm is selected.

  3. In the left-hand menu, select Authentication.

  4. On the Flows tab, select New.

    First login
  5. Enter an Alias, for example, Simple Login Flow, and select Save.

    Simple login flow
  6. With the new flow selected, select Add execution.

    Add execution
  7. In Provider, find and select Create User If Unique.

    Provider settings
  8. Select Save.

  9. In Requirement, select ALTERNATIVE.

    Requirement settings
  10. The next time the user logs in, we want them to go directly to the platform. This involves the Browser Authentication flow:

    • Log in to the Keycloak Administration Console.

    • Ensure the Ataccamaone realm is selected.

    • In the left-hand menu, select Authentication.

    • In Flows, select Browser.

      Browser authentication flow
  11. On the Identity Provider Redirector line, select Actions and then Config.

    Configure actions
  12. Enter the name of the identity provider, for example, saml, in both Alias and Default Identity Provider.

    Identity provider redirector
  13. Select Save.

Single sign-on configuration

  1. Log in to the Keycloak Administration Console.

  2. Ensure the Ataccamaone realm is selected.

  3. In the left-hand menu, select Identity Providers.

  4. Select the name of the previously created identity provider, for example, saml:

    Identity provider integration
  5. In First Login Flow, select the flow that we created in the previous section, for example, Simple Login Flow.

    First login flow
  6. In SAML Config, set NameID Policy Format to Email.

    NameId Policy
  7. The SAML Config section should now look similar to this:

    SAML config

    If so, select Save. If not, go back and edit as necessary.

Set up mappers

  1. Log in to the Keycloak Administration Console.

  2. Ensure the Ataccamaone realm is selected.

  3. In the left-hand menu, select Identity Providers.

  4. Select the name of the previously created identity provider, for example, saml.

  5. Select the Mappers tab.

  6. Select Create.

  7. Enter a Name,for example, Surname mapper, and then select Attribute Importer as the Mapper Type.

    Attribute importer
  8. The following screen appears. The important fields here are Attribute Name and User Attribute Name.

    Surname mapper
    • Attribute Name: For example,

    • User Attribute Name: lastName.

      The value of Attribute Name must match the name of the attribute coming from the Azure AD claims.

      There are a few ways to determine this. In the example XML, the claims are listed as part of the <fed:ClaimTypesOffered> section. However, this doesn’t necessarily mean that these attributes will be returned as part of the security handshake.

      Refer to Map the claims to retrieve and decode the claims as they are returned during the login process.

      Use camel case for User Attribute Name.
  9. Repeat the same for the first name:

    First name mapper
    • Attribute Name: For example,

    • User Attribute Name: firstName.

Map the claims

This section provides a method for capturing and decoding the claims that are returned by Azure Active Directory as part of the login process. For the purpose of this guide, we are using Google Chrome as our browser.

For this method to work, a user needs to be set up in Azure AD with the correct permissions (for example, AD Group) that provides the user with access to the Ataccama Platform.
  1. Log in to the Keycloak Administration Console.

  2. Ensure the test user does not already have a record in Keycloak. If the record exists, make a separate note of the associated roles and delete the user record.

  3. Open an Incognito Google Chrome window (Ctrl+Shift+N).

  4. Open Developer Tools (Ctrl+Shift+I).

    For ease of use, move the console to the bottom of the window. Select the more options menu and then the third Dock side option.

    Move console to dock side
  5. Ensure the Preserve log option is selected.

  6. Attempt to log in to Ataccama, for example, by trying to access https://<ataccama_platform_fqdn>/.

  7. In the console, find the Azure AD reply that contains the SAMLResponse.

    SAML response
  8. Copy the entire SAMLResponse (here starting with PHNhbWxwOlJlc3BvbnNlIElEPSJfYTE0ZWY2ODQtZmEwMy00OT…) and use a website such as to decode it. After reformatting the XML, the (anonymised) response should look similar to this:

    Example SAML response
    <?xml version="1.0" encoding="UTF-8"?>
    <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_a14ef684-fa03-4990-a427-4dfb85478533" Version="2.0" IssueInstant="2019-07-02T07:19:35.874Z" Destination="https://<ataccama_platform_fqdn>/auth/realms/ataccamaone/broker/saml/endpoint" InResponseTo="ID_9338c443-1ecd-4f6f-8a24-4622ded87ca7">
       <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion"></Issuer>
          <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
       <Assertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="_3ae03e36-e461-4f61-b204-720f19f17300" IssueInstant="2019-07-02T07:19:35.858Z" Version="2.0">
          <Signature xmlns="">
                <CanonicalizationMethod Algorithm="" />
                <SignatureMethod Algorithm="" />
                <Reference URI="#_3ae03e36-e461-4f61-b204-720f19f17300">
                      <Transform Algorithm="" />
                      <Transform Algorithm="" />
                   <DigestMethod Algorithm="" />
             <NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"></NameID>
             <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
                <SubjectConfirmationData InResponseTo="ID_1234…7ca7" NotOnOrAfter="2019-07-02T07:24:35.858Z" Recipient="https://<ataccama_platform_fqdn>/auth/realms/ataccamaone/broker/saml/endpoint" />
          <Conditions NotBefore="2019-07-02T07:14:35.858Z" NotOnOrAfter="2019-07-02T08:19:35.858Z">
             <Attribute Name="">
             <Attribute Name="">
             <Attribute Name="">
                <AttributeValue>Anderson, Adrian</AttributeValue>
             <Attribute Name="">
             <Attribute Name="">
             <Attribute Name="">
             <Attribute Name="">
             <Attribute Name="">
             <Attribute Name="">
          <AuthnStatement AuthnInstant="2019-07-02T07:19:35.101Z" SessionIndex="_3ae03e36-e461-4f61-b204-720f19f17300">

    The attribute names can be clearly seen in the response. The full value from between the double-quotes is required.

  9. Check the resulting user record in Keycloak. If the mappers were not set up correctly, update the mappers, delete the user record, and log in to the platform again.

Map the roles

Before proceeding with this section, make sure you have completed setting up the identity-related claims (see Set up mappers).
To get mappers for identity providers, see Keycloak Admin REST API documentation.
  1. Create a counterpart in Keycloak for each role in Active Directory, for example, AD_ROLE_ADMIN.

  2. Map those roles to Ataccama-specific roles as required.

  3. Navigate to Identity Provider > Identity Provider Mappers.

  4. Identify the claim as groups from AD. See the example:

    <Attribute Name=""><AttributeValue>a8dfc3d4-c0c3-48f1-9d8e-157c645ef26e</AttributeValue></Attribute>
  5. Use SAML Attribute to Role, and fill in as required. Based on the previous example, this would be:

    • Attribute Name:

    • Attribute Value: a8dfc3d4-c0c3-48f1-9d8e-157c645ef26e.

    • Role: AD_ROLE_ADMIN.

  6. Save the mapper.

  7. Repeat these steps for as many groups as needed.

Was this page useful?