Skip to main content

User Provisioning

Getting the sample data into Keycloak​

Steps​

  1. Create the user profile custom attributes in Keycloak:
AttributeValueNotes
jobTitleA stringOptional profile attribute.
departmentA stringOptional profile attribute.
employeeTypeA stringOptional profile attribute.
managerThe manager's DN, e.g. uid=james.farrell,ou=people,dc=shane-longman,dc=orgThe one attribute the access-control model depends on — it enables the manager hierarchy.
  1. Create the realm roles in Keycloak:
TierKeycloak role nameCommon titles (the role covers all of these)Who this is in the sample
Entry-level practitioneranalystAnalyst, Associate AnalystGraduate assistants and junior staff who handle data collection, market research, financial modeling, slide deck preparation, and primary task execution.
Mid-level professionalconsultantConsultant, Senior ConsultantExperienced professionals responsible for managing specific workstreams, conducting client interviews, designing solutions, and drafting deliverables.
Day-to-day project leadermanagerManager, Engagement Manager, Project LeaderExperienced leaders who oversee day-to-day project operations, manage delivery timelines, lead consultant teams, and maintain primary client relationships.
Senior practice leadersenior-managerSenior Manager, Director, Associate PartnerSenior leaders tasked with driving multi-project delivery, leading sector or functional practice areas, and actively generating new business.
Co-owner / senior executivepartnerPartner, Principal, Managing DirectorCo-owners or senior executives of the firm focused on revenue generation, strategic client account management, firm governance, and practice development.
  1. In Keycloak's Admin Console, add an LDAP provider.

    Configure the Custom User Attribute Mappers:

Mapper NameMapper TypeKeycloak AttributeLDAP Attribute
job-titleuser-attribute-ldap-mapperjobTitletitle
departmentuser-attribute-ldap-mapperdepartmentdepartmentNumber
employee-typeuser-attribute-ldap-mapperemployeeTypeemployeeType
locality-cityuser-attribute-ldap-mapperl
state-regionuser-attribute-ldap-mapperst
manager-dnuser-attribute-ldap-mappermanagermanager

The federation mapper maps the LDAP attributes into Keycloak's user profile. When you configure the group-ldap-mapper and trigger a synchronisation (or when a user logs in), Keycloak automatically reads the LDAP directory branch and creates the corresponding groups in Keycloak dynamically. You assign realm roles to the groups after the LDAP group sync has run at least once (or after you manually trigger the initial sync) so that the synced groups exist in Keycloak.

The manager attribute arrives as a DN and is resolved to a sub. On initial load the manager-dn mapper copies the LDAP manager attribute as-is, so the Keycloak user's manager attribute holds the manager's DN (e.g. uid=james.farrell,ou=people,dc=shane-longman,dc=org) — a directory string, not a Keycloak identifier. The access-control model needs the sub (UUID) of the manager's user — the same token sub the enforcement layer compares ownedBy and assignedTo against (Access Control — design document). Resolving a DN to that sub is a one-time, per-manager lookup against the synced users (DN → user → sub), cached afterwards; every manager value is exactly one DN, so the lookup is cheap. This resolution is not yet implemented — it is tracked as an open roadmap item (Roadmap).

info

Every user includes l (locality / city) and st (state / province) attributes. At this point these geographic attributes are for reporting and filtering only — they do not gate access to records.

References​