> ## Documentation Index
> Fetch the complete documentation index at: https://docs.authsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Federated Login with MFA

> Learn how to set up federated login with SSO and Authsignal in Keycloak.

## Overview

This guide demonstrates how to set up federated login (SSO) in Keycloak, using the Authsignal provider for post-login multi-factor authentication (MFA).

<Frame caption="Federated login with MFA via Authsignal pre-built UI.">
  <video controls className="w-full aspect-video" src="https://mintcdn.com/authsignal-23/8bvDamO56aVu-Ay2/images/docs/integrations/keycloak/keycloak-sso.mp4?fit=max&auto=format&n=8bvDamO56aVu-Ay2&q=85&s=bdebaadb793b8dc0fea611a72718d7c0" data-path="images/docs/integrations/keycloak/keycloak-sso.mp4" />
</Frame>

## Step 1: Create Your Authsignal Flow

First, ensure you have created a custom authentication flow that uses the Authsignal provider. The screen shot below shows an example of the flow you need to create.
You can follow the steps in the [Keycloak MFA guide](./keycloak-mfa) to configure the authsignal provider (click on the cog button to open the settings).

<Frame caption="Accessing the browser flow">
  <img src="https://mintcdn.com/authsignal-23/8bvDamO56aVu-Ay2/images/docs/integrations/keycloak/keycloak-federated-flow-details.png?fit=max&auto=format&n=8bvDamO56aVu-Ay2&q=85&s=01be48e38a9b12c2d7e4b8ecacce6c97" alt="Setting up the federated flow" width="2976" height="1386" data-path="images/docs/integrations/keycloak/keycloak-federated-flow-details.png" />
</Frame>

## Step 2: Configure the Identity Provider

Navigate to **Identity providers** in the Keycloak admin panel.

<Frame caption="Identity providers section in Keycloak">
  <img src="https://mintcdn.com/authsignal-23/8bvDamO56aVu-Ay2/images/docs/integrations/keycloak/keycloak-identity-provider-page.png?fit=max&auto=format&n=8bvDamO56aVu-Ay2&q=85&s=0f144a6bdb5e18aacc86fc3721845832" alt="Identity providers section" width="2970" height="1618" data-path="images/docs/integrations/keycloak/keycloak-identity-provider-page.png" />
</Frame>

Select your SSO provider (e.g., OpenID Connect v1.0, SAML v2.0, etc.).

Configure the identity provider with your federated login provider configuration details.

<Frame caption="Example of the identity provider setup">
  <img src="https://mintcdn.com/authsignal-23/8bvDamO56aVu-Ay2/images/docs/integrations/keycloak/keycloak-identity-provider-setup.png?fit=max&auto=format&n=8bvDamO56aVu-Ay2&q=85&s=f6d974c486cec44d11292776508441a9" alt="Example of the identity provider setup" width="3054" height="1614" data-path="images/docs/integrations/keycloak/keycloak-identity-provider-setup.png" />
</Frame>

Set the **Post login flow** to the custom authentication flow you configured in step 1.

<Frame caption="Set Post login flow to Authsignal">
  <img src="https://mintcdn.com/authsignal-23/8bvDamO56aVu-Ay2/images/docs/integrations/keycloak/keycloak-identity-provider-post-login.png?fit=max&auto=format&n=8bvDamO56aVu-Ay2&q=85&s=70664cd6a69446726b457bca61dbb4aa" alt="Set Post login flow" width="3018" height="1722" data-path="images/docs/integrations/keycloak/keycloak-identity-provider-post-login.png" />
</Frame>

## Step 3: Save and Test

Click **Save** at the bottom of the page.

Now, when users login via your federated SSO provider, they will be routed through the Authsignal post-login flow for MFA.

<Info>
  If you need to create a new authentication flow, or want to customize the steps, see the [Keycloak MFA guide](./keycloak-mfa).
</Info>

## Summary

You have now enabled federated login with SSO and Authsignal MFA in Keycloak. Users authenticating via your identity provider will be prompted for MFA according to your Authsignal flow configuration.
