How Keycloak signs users into the AWS access portal through Identity Center
A team that already runs Keycloak usually wants one sign-in for the AWS access portal, the AWS console and the CLI. Identity Center can do this: it accepts SAML 2.0 assertions from Keycloak as an external identity provider, so Keycloak handles the login and Identity Center handles everything AWS-specific. The second requirement is easy to miss: provisioning users and groups into Identity Center is a separate, required step, and SAML sign-in alone does not create them.
The three systems each own one job. Keycloak authenticates people: passwords, MFA, passkeys and the session policies you configure in the realm. Identity Center decides what an authenticated person can reach, through account assignments and permission sets that map groups to AWS roles. The provisioning source, which is either an HR system or governance tool speaking SCIM or an administrator creating entries by hand, supplies the users and groups that Identity Center stores. Because SAML cannot be queried for directory data, Identity Center must already hold a user and group before it can assign them. Keycloak's documented SCIM support manages users and groups inside a realm, so a Keycloak realm can act as the source for that provisioning, but you should confirm with AWS documentation which provisioning path fits your setup before you commit.
Decide the source of truth before you build the SAML connection. If Keycloak holds the people and their groups, plan how group membership flows into Identity Center and who removes access when someone leaves. Confirm the SAML attribute names and the group claim Identity Center expects, and test one user from each group end to end, including CLI login, before you grant broader access. An illustrative check: remove a user from a Keycloak group and confirm that the matching AWS assignment changes on the next provisioning run.
What you need in place before configuring the SAML trust
The SAML trust between Keycloak and IAM Identity Center only works when both sides are ready first. Keycloak must be reachable over TLS with a clean admin boundary, the realm must hold the users and groups you intend to assign, and the AWS side must be set up under the right account owner before any metadata is exchanged.
Production-ready Keycloak deployment
Keycloak should already run in production form before you add AWS. That means TLS on all communication, a reverse proxy with path restrictions, and the admin console and Administration REST API served on a different hostname or context path from public frontend URLs. The SAML endpoints AWS calls are public-facing, so the hostname used in the issuer and metadata must be the one users reach. Confirm the Keycloak version your team supports with the project's current release information, not a version carried over from another environment.
Production guideDedicated realm with test users
Create a dedicated realm for the AWS trust rather than reusing a realm that serves unrelated applications, so client settings, login flows and token mappers stay isolated. Populate it with a small set of test users and groups that mirror the access model you plan to assign in AWS, such as one administrator group and one read-only group. Keep the group names stable, because they become the values that IAM Identity Center later uses for account and application assignments.
AWS organization and IAM Identity Center enabled
IAM Identity Center must be enabled in the AWS organization that will hold your accounts. Confirm which Region hosts the Identity Center instance, because that choice is difficult to reverse and affects where the access portal lives. Check with your AWS team that the Identity Center service and identity source options in your environment match the current AWS documentation, since console flows change over time.
Management account owner in the loop
Changing the identity source and managing SAML settings require administrative access in the organization's management account. Identify the person who holds the root or equivalent owner credentials and agree on who will perform each step, because routine assignments can be delegated but the identity source change is a privileged action. Plan this sign-off before the change window, and record which account owner approved the configuration.
Certificate and metadata exchange
The trust depends on exchanging SAML metadata in both directions. Keycloak publishes its SAML descriptor and signing certificate for the client, while IAM Identity Center provides its own metadata and assertion consumer details for the Keycloak client. Decide how the signing certificate will be rotated and who is notified when it changes, because an expired or mismatched certificate breaks sign-in for every user. Store the exchanged files under change control so they can be compared during troubleshooting.
Configuring the SAML federation from Keycloak to Identity Center
This sequence sets up Keycloak as a SAML 2.0 identity provider that IAM Identity Center trusts, so that users can sign in to the AWS access portal with credentials managed in Keycloak.
Confirm the Identity Center and Keycloak prerequisites
The platform engineer or identity administrator confirms that the Keycloak realm is reachable over HTTPS at its public frontend URL, that the admin console is on a separate hostname or path, and that the team has admin access to both the Keycloak realm and the IAM Identity Center instance in the management account. Open the Identity Center console and record the region, the AWS access portal URL and the service provider metadata values it displays for the external identity provider setup. Done when the team has written down the values it will paste into Keycloak and confirmed who can approve changes in each system.
Create the SAML client in Keycloak
In the target realm, create a SAML client using the entity ID that Identity Center provides and set the assertion consumer service URL to the matching value from the same console screen. Keep the client's signing and encryption settings explicit so that reviewers can see which keys sign assertions. Done when the client appears in the realm's client list with the entity ID and ACS URL matching Identity Center character for character, and a test user in that realm can see the client in the account context.
Set the NameID and attribute mappers
Configure the NameID format and value so each user maps to a stable, unique identifier that Identity Center can match to a provisioned user, typically the email or username that your provisioning process also uses. Add attribute mappers for the name and email claims that Identity Center expects, such as given name, family name and email, and confirm that group membership is included only if you plan to use it for assignments. Done when a test user's login produces an assertion whose NameID and attributes match the values that will exist in Identity Center's user store.
Export Keycloak's SAML metadata and signing certificate
Download the SAML descriptor for the realm or client from Keycloak, and export the realm's active RS256 signing certificate from the realm keys settings so it can be reviewed and, if needed, uploaded separately. Check the metadata for the correct entity ID, the single sign-on service location and the signing key, and confirm the hostname matches the public frontend URL and not an internal address. Done when the metadata file opens cleanly, lists the expected endpoints and includes a certificate whose expiry date the team has recorded.
Switch Identity Center to an external identity provider
In the Identity Center settings, change the identity source to external identity provider, and upload the Keycloak metadata file in the form the console requests. Review the service provider metadata that Identity Center generates and confirm it matches the client you created in Keycloak. Expect that switching the identity source affects existing users and assignments, so check the current state first and record it. Done when the console accepts the metadata and shows the identity provider as configured without validation errors.
Provision users and groups into Identity Center
Because SAML cannot be queried for users and groups, create or sync each user and group in Identity Center before assigning them to accounts or applications, either through SCIM from your provisioning source or manually for a small pilot. Match the usernames to the NameID values that Keycloak sends. Done when a test user and a test group appear in Identity Center's user and group lists with the same identifiers Keycloak will assert, and an account assignment for that group is saved.
Confirm the trust with a test sign-in
Sign in to the AWS access portal with the test user through the Keycloak login page, and inspect the SAML response in a browser developer tool or SAML tracer to confirm the issuer, audience, NameID, signature and validity window. Then open an assigned account and confirm that the role appears, and run aws sso login from the CLI with the same profile to verify the CLI path. Done when the portal and CLI sign-ins succeed for the test user, the assertion inspection shows the expected values, and the team has recorded the Keycloak certificate and metadata versions for future rotation.
How a portal sign-in and CLI session move between Keycloak and Identity Center
The diagram starts at the user's browser, which opens the AWS access portal and is redirected to IAM Identity Center. Identity Center sends a SAML authentication request to Keycloak, where the user signs in and completes MFA. Keycloak returns a signed SAML assertion to Identity Center, which then issues the portal and CLI session. Check that users and groups were provisioned into Identity Center before assignments, because SAML alone cannot list them. The provisioning path shows SCIM or manual entry feeding Identity Center separately.
Sign-in and CLI session flow, with provisioning shown as a separate path into Identity Center.
Why users and groups must exist in Identity Center before assignments
SAML is an authentication exchange, not a directory query. When a user signs in to the AWS access portal, Keycloak sends a SAML assertion that confirms who the user is and, if configured, which attributes they carry. IAM Identity Center cannot ask Keycloak for a list of users or groups, so it needs its own copies of those objects before it can assign them to AWS accounts or applications. According to the AWS IAM Identity Center documentation on external identity providers, every user and group must be provisioned into Identity Center, either through SCIM or manually, before assignments are made. Plan this as a separate step from the SAML setup, because a working sign-in flow does not prove that any account assignment will work.
The practical consequence is that a user who signs in successfully through Keycloak but has no matching object in Identity Center cannot be granted access. Assignments are made to Identity Center users and groups, so a group-based design depends on the group objects existing there first. If a Keycloak group is renamed or removed and the change is not carried into Identity Center, existing assignments can point at objects that no longer match the identity source. Before go-live, export the user and group lists from both systems, compare them for a sample of accounts, and confirm the username attribute in the SAML assertion matches the value Identity Center stores for each user.
Confirm with AWS how Identity Center handles a user whose SAML sign-in arrives before that user has been provisioned. Your test plan should cover that case explicitly, including the error the user sees and whether the account is created or rejected at that point. The answer determines whether provisioning must complete before users are onboarded in Keycloak, and it shapes the order of your rollout runbook.
Choosing a provisioning option when Keycloak is the source
Manual provisioning means an administrator creates each user and group directly in IAM Identity Center and then makes assignments to accounts and applications. It requires no integration work and no endpoint to operate, which makes it a reasonable fit for a small pilot or a team with few joiners, movers and leavers. The cost is that Identity Center and Keycloak become two records of the same person, and every change in Keycloak must be repeated by hand.
- Low setup effort: No SCIM endpoint, token or connector needs to be built or monitored.
- Drift risk: A user removed in Keycloak can keep an active Identity Center account until someone notices.
- Audit trail: Changes are recorded as administrator actions, so access reviews need a separate record of who approved each change.
- Scaling limit: Change volume grows with headcount and group count, and manual steps tend to slip first during reorganizations.
- Exit path: Moving to automated provisioning later means reconciling existing users and group IDs.
Confirm with the team who will own each change request and how often the two directories will be compared.
In this option, IAM Identity Center is the SCIM client and pushes users and groups to an endpoint that your team operates. The endpoint must accept the SCIM requests that Identity Center sends and map them to a directory or store that Keycloak can read or that the sign-in path can trust. This keeps Identity Center as the system that owns assignments, but it moves the integration burden onto your platform team.
- Endpoint ownership: Someone must build, host, patch and monitor the SCIM service and its credentials.
- Source of truth: Decide whether the endpoint reads from Keycloak, from an HR feed or from a directory, because each choice changes who can add or remove access.
- Failure handling: Plan what happens when the endpoint is unreachable, including whether deprovisioning still reaches Identity Center.
- Attribute mapping: User name, email and group membership must line up with the SAML assertion Keycloak sends, or sign-in will fail or land in the wrong permission set.
- Verification: Test create, update, group change and delete events before any production assignment.
Confirm the exact SCIM endpoint behavior and supported attributes in the current AWS documentation before committing to this design.
Keycloak's documented SCIM support is an API for managing users and groups inside a realm, and HR systems and governance tools use it to provision into Keycloak. That is a different direction from the one Identity Center needs. Keycloak receiving identities through this API does not, by itself, place those users and groups into Identity Center, so the team must confirm how identities travel from Keycloak to Identity Center before relying on this path.
- Direction check: Confirm whether you need Keycloak to be the upstream source of truth for Identity Center, or only the sign-in provider for users that already exist there.
- Bridge design: Identify the component that reads Keycloak users and groups and provisions them into Identity Center, and who operates it.
- Governance workflow: Joiner, mover and leaver events from HR or a governance tool can drive Keycloak, but the removal of access must reach Identity Center as well.
- Group model: Keep the group names used for assignments stable, since renaming a group in Keycloak can break assignments downstream.
- Evidence: Auditors will ask for records showing that a Keycloak change produced the matching Identity Center change.
Confirm the bridge design and its ownership in writing before any assignment is built on it.
Before selecting an option, settle which system is the source of truth for people and which system must hold their assignments. If Keycloak is the only place identities are maintained, the team needs a path that carries those identities into Identity Center. If Identity Center is already the system of record, Keycloak only needs to authenticate people, and the provisioning question is narrower. Writing down this direction first prevents building a pipeline that runs in the wrong direction.
- Map the source: List where joiners, movers and leavers are recorded today, such as HR, a directory or Keycloak.
- Map the consumers: List which AWS accounts and applications need assignments and which group names they reference.
- Name the owner: Assign one team to each sync path and one owner for group naming.
- Test removal: Verify that deleting or disabling a person in the source removes their access in both systems.
- Plan for mixed states: Identify users who exist in Identity Center but not in Keycloak, and decide how they are handled.
Confirm the source of truth and the direction of each sync with your identity, security and cloud teams before you select a provisioning option.
Mapping Keycloak attributes and groups to Identity Center identities
This table compares each identity element Identity Center needs from Keycloak with the SAML or provisioning path that carries it. Read it before building the Keycloak client mappers, because Identity Center will not show a user or group that was never provisioned, and a mismatch in names or identifiers breaks assignments silently. Confirm exact attribute names and formats against current AWS documentation before you configure anything.
| Identity element | Keycloak source | Identity Center target | What to confirm |
|---|---|---|---|
| User sign-in identifier (NameID) | Username or a stable user ID, chosen in the SAML client's NameID mapper | Matched to the Identity Center user name when the SAML assertion arrives | Confirm which NameID format AWS expects for your setup and whether it must equal the provisioned user name exactly |
| Unique user identifier | Keycloak user ID (UUID) or username, held constant across renames | Identity Center user ID on provisioned users, used to link sign-ins to records | Decide whether usernames can change; if they can, pick an immutable value and confirm how AWS keys users during SCIM or manual sync |
| User name | Username mapper on the SAML client | User name attribute on the Identity Center user record | Confirm the attribute name AWS maps to the user name and whether case sensitivity affects matching |
| Email address | Email attribute mapper (user property email) | Email attribute on the Identity Center user record | Confirm the attribute name and that the value is unique per user, since email is often used for account recovery |
| Given name and family name | firstName and lastName user properties via attribute mappers | Name attributes on the Identity Center user record | Confirm the expected SAML attribute names and whether name fields are required at provisioning time |
| Group membership | Group mapper emitting group names or paths in the assertion, or groups from Keycloak's SCIM or admin API | Groups provisioned into Identity Center, then assigned to accounts and applications | Group names must match exactly between systems; agree on a naming convention and whether full group paths are used |
Securing the SAML trust and the admin path
The SAML trust between Keycloak and IAM Identity Center is only as strong as the signing keys, the admin path that changes them, and the sign-in controls in front of every AWS session. The cards below cover those controls and the plan for when the identity provider is unavailable.
Signed assertions and certificate lifecycle
Keycloak signs the SAML assertions that IAM Identity Center trusts, so the realm signing certificate is the核心 of the trust. Confirm which key and certificate the SAML client uses, record its expiry, and plan the rotation window with AWS so the metadata update lands before the old certificate stops working. Keep a dated record of every change to the signing key, because an unplanned rotation locks every AWS user out at once.
IAM Identity Center IdP docsSeparate admin hostname
Keycloak's production guidance calls for exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. Apply this to the Keycloak that signs users into AWS, because anyone who can change the SAML client can change where AWS trusts assertions from. Restrict the admin hostname to a management network or VPN and confirm that the public reverse proxy does not forward it.
Keycloak production guideMFA for every user who reaches AWS
Enforce multi-factor authentication in Keycloak itself for every user who can sign in to the AWS access portal or CLI, rather than relying on a prompt in one downstream application. Keycloak documents OTP policies, WebAuthn and passkeys, so choose the factors your policy allows and test the enrollment and recovery path. Confirm that no group or service account is exempt, because a single exemption becomes the weakest route into AWS.
Limit who changes SAML client settings
Changes to the SAML client, its mappers and its signing settings alter what AWS accepts, so treat them as privileged. Limit realm administration to a small named group, separate that group from people who manage ordinary users, and require a second reviewer for changes to the AWS client. Review the admin events list regularly to confirm that nobody outside the group edited the client.
Sign-in events in Keycloak and CloudTrail
Log sign-in events in Keycloak and collect them centrally, then correlate them with AWS activity in CloudTrail. Keycloak's sign-in and admin events show who authenticated and which client they used, while CloudTrail records IAM Identity Center and account activity. Confirm that Keycloak logs leave the server before any local rotation, and that you can trace one user from the Keycloak login to a CloudTrail event. Keycloak metrics at the management endpoint can support monitoring of login health, but they are not an audit trail.
Break-glass path when the IdP fails
If Keycloak is down or its certificate has expired, users who depend on it cannot reach AWS. Plan a break-glass path in advance: a small set of named administrators who can sign in to AWS through a method that does not depend on Keycloak, held under strict controls and tested on a schedule. Confirm with AWS how these accounts are set up and how access is granted and revoked, then rehearse the switch so the path works when needed.
Common failures when Keycloak signs into IAM Identity Center
This table lists the failures teams most often hit when Keycloak is the SAML identity provider for IAM Identity Center, with the likely cause and the first thing to check for each. Read it in order during setup and again after any certificate rotation, hostname change or provisioning run. Most sign-in failures trace back to a mismatch between the two sides, and most access gaps trace back to skipped provisioning.
| Failure | Likely cause | Check first |
|---|---|---|
| Sign-in fails with a signature error after rotation | Keycloak realm signing key was rotated or replaced, but Identity Center still holds the old certificate in its SAML metadata | Compare the active realm signing certificate in Keycloak with the certificate loaded in Identity Center, then re-import the metadata if they differ |
| Authentication rejected with an invalid audience or issuer message | Typo in the entity ID or ACS URL on either side, or a trailing slash or case difference | Copy the Identity Center ACS URL and issuer exactly into the Keycloak SAML client, then compare the SAML response audience value |
| User signs in successfully but sees no accounts or applications | User was never provisioned into Identity Center, so SAML authentication succeeds but no assignment can match the identity | Confirm the user and their groups exist in Identity Center before assignments, through SCIM or manual creation |
| Group assignments do not apply to the expected users | Group names differ between Keycloak and Identity Center, or the group was renamed after provisioning | Compare the group display names in both systems character by character and align them before reassigning |
| Sign-in errors that mention the assertion not yet valid or expired | Clock skew between the Keycloak host, the reverse proxy and the user's device, which pushes timestamps outside the allowed window | Check time synchronization with NTP on the Keycloak nodes and the proxy, and compare timestamps in a captured SAML response |
| Redirect loops, wrong host in the login flow, or certificate warnings | Keycloak frontend URL does not match the public hostname behind the reverse proxy, or TLS is not terminated correctly | Confirm the public hostname in Keycloak frontend settings matches the proxy hostname and that HTTPS is used end to end |
| Users added in Keycloak do not appear after a provisioning run | The source of provisioning is not configured to send Keycloak users, or the provisioning job was never run after the Keycloak change | Check the provisioning source settings and the last run result, then confirm the change reached Identity Center |
Questions teams ask before connecting Keycloak to AWS Identity Center
Can Keycloak be the only source of identities for AWS Identity Center?
Yes, Keycloak can act as the sign-in source through SAML 2.0, but AWS IAM Identity Center still needs its own copy of every user and group before you can assign them to accounts or applications. SAML sign-in alone does not let Identity Center look up users or groups, so the directory must be populated first. The practical question is how that population happens: through SCIM from Keycloak's side, through a provisioning tool your team already runs, or by hand. Confirm the chosen path during scoping, because it determines who owns user lifecycle after go-live and how deprovisioning is handled.
What makes the effort for this integration grow or shrink?
The main drivers are the number of AWS accounts and applications in scope, the provisioning choice, how MFA is designed across both systems, and how many groups must map to permission sets. A small set of accounts with a handful of groups is a different job from dozens of accounts with nested group logic and multiple environments. Provisioning choice matters most: automating user and group sync adds design and testing work, while manual population is simpler to build but shifts ongoing work onto your administrators. Ask for the written scope to list each account, group and permission set explicitly.
What recurs after go-live once Keycloak and Identity Center are connected?
Three things recur: certificate rotation for the SAML trust, Keycloak upgrades, and provisioning drift. The signing certificate and metadata must be exchanged again when they change, and an expired certificate stops sign-in. Keycloak releases on a regular cadence, so the realm, client and SAML settings need retesting after each upgrade. Provisioning drift is the quiet risk: users removed or regrouped in Keycloak but not in Identity Center, or the reverse, leave stale access. Ask for a documented owner for each recurring task and a test of sign-in and deprovisioning after every change.
Can an internal team set this up without outside help?
Often yes, if the team already runs Keycloak in production and has administrators for both Keycloak and AWS with time to test. The skills involved are SAML trust configuration, group design, provisioning, and access testing across accounts. The risk is less the first sign-in and more the edge cases: wrong attribute mappings, misassigned permission sets, and a missing break-glass path if federation fails. Teams without recent SAML or AWS identity experience usually benefit from a written scope with a test group and a review of the finished configuration. Whichever route you choose, the AWS IAM Identity Center documentation on external identity providers is the natural starting reference.
What does the work need from our side?
Plan for four inputs: administrative access to AWS IAM Identity Center and the target accounts, administrative access to the Keycloak realm that will act as the identity provider, a named test group of users who can verify sign-in and access without affecting production, and a decision owner who can approve group-to-permission-set mappings. Identity Center changes should be made by an administrator who understands the account structure, and Keycloak changes should follow your existing change process. Ask the provider to list every access grant needed in the written scope so approvals can happen before work starts.
How long does the integration take?
The duration depends on the written scope and your environment, so no fixed figure applies. The largest variables are the number of accounts and groups, whether provisioning is automated, the state of existing Keycloak and AWS configuration, and how many approval cycles your change process requires. Ask for a timeline tied to named phases: design, a test group, production cutover, and handover. Any timeline should also show when testing and access reviews happen, because those phases usually take longer than the configuration itself.
What does Keycloak need to provide for SCIM-based provisioning?
Keycloak's documented SCIM support is an API for managing users and groups inside a realm, which HR systems and governance tools typically use to provision accounts into Keycloak. Whether that API feeds AWS Identity Center directly depends on the provisioning design you choose, so confirm it in the scope rather than assuming it. Ask the provider to document which system is the source of truth for each user and group, how deprovisioning propagates, and which component performs the sync. Confirm the exact capabilities against the current Keycloak server administration guide for your Keycloak version.
How DeployOpen works on this
DeployOpen plans, implements, documents and supports self-hosted Keycloak inside your own infrastructure, including the SAML trust, the Identity Center side and the provisioning path that your identity team already runs. Engagements are fixed-scope, so the sign-in flow, user and group model and provisioning method are agreed in writing before work starts.
How we scope
- Written scope names the Keycloak realm, the SAML client for Identity Center and the Identity Center instance it will federate with.
- We confirm which users and groups map to which AWS accounts and permission sets before any assignment work begins.
- The scope records who chooses the provisioning method, SCIM from Keycloak or another source, and who owns each step.
How we build
- We configure the Keycloak SAML client, signing certificate handling and attribute mappers that Identity Center expects for sign-in.
- We set up the Identity Center external identity provider and verify that provisioned users and groups appear before assignments are tested.
- We test sign-in to the AWS access portal and the CLI path, including a user who lacks an assignment and sees the expected denial.
How we hand over
- You receive configuration records for the Keycloak client, Identity Center provider settings, mappers and the group-to-permission-set design.
- Runbooks cover certificate renewal, metadata changes, adding a group and removing a leaver so your team can repeat each task.
- We walk your identity and cloud administrators through the sign-in test results and the known limits of the provisioning method chosen.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover, scoped separately from the build.
- Keycloak upgrades are planned against the release notes before rollout, so SAML settings are rechecked on each change.
- Retesting after Keycloak or Identity Center changes is included in the retainer scope where agreed in writing before work starts.

