1. Packages
  2. Keycloak Provider
  3. API Docs
  4. ldap
  5. UserAttributeMapper
Keycloak v6.4.0 published on Wednesday, Apr 16, 2025 by Pulumi

keycloak.ldap.UserAttributeMapper

Explore with Pulumi AI

Allows for creating and managing user attribute mappers for Keycloak users federated via LDAP.

The LDAP user attribute mapper can be used to map a single LDAP attribute to an attribute on the Keycloak user model.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";

const realm = new keycloak.Realm("realm", {
    realm: "my-realm",
    enabled: true,
});
const ldapUserFederation = new keycloak.ldap.UserFederation("ldap_user_federation", {
    name: "openldap",
    realmId: realm.id,
    usernameLdapAttribute: "cn",
    rdnLdapAttribute: "cn",
    uuidLdapAttribute: "entryDN",
    userObjectClasses: [
        "simpleSecurityObject",
        "organizationalRole",
    ],
    connectionUrl: "ldap://openldap",
    usersDn: "dc=example,dc=org",
    bindDn: "cn=admin,dc=example,dc=org",
    bindCredential: "admin",
});
const ldapUserAttributeMapper = new keycloak.ldap.UserAttributeMapper("ldap_user_attribute_mapper", {
    realmId: realm.id,
    ldapUserFederationId: ldapUserFederation.id,
    name: "user-attribute-mapper",
    userModelAttribute: "foo",
    ldapAttribute: "bar",
});
Copy
import pulumi
import pulumi_keycloak as keycloak

realm = keycloak.Realm("realm",
    realm="my-realm",
    enabled=True)
ldap_user_federation = keycloak.ldap.UserFederation("ldap_user_federation",
    name="openldap",
    realm_id=realm.id,
    username_ldap_attribute="cn",
    rdn_ldap_attribute="cn",
    uuid_ldap_attribute="entryDN",
    user_object_classes=[
        "simpleSecurityObject",
        "organizationalRole",
    ],
    connection_url="ldap://openldap",
    users_dn="dc=example,dc=org",
    bind_dn="cn=admin,dc=example,dc=org",
    bind_credential="admin")
ldap_user_attribute_mapper = keycloak.ldap.UserAttributeMapper("ldap_user_attribute_mapper",
    realm_id=realm.id,
    ldap_user_federation_id=ldap_user_federation.id,
    name="user-attribute-mapper",
    user_model_attribute="foo",
    ldap_attribute="bar")
Copy
package main

import (
	"github.com/pulumi/pulumi-keycloak/sdk/v6/go/keycloak"
	"github.com/pulumi/pulumi-keycloak/sdk/v6/go/keycloak/ldap"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		realm, err := keycloak.NewRealm(ctx, "realm", &keycloak.RealmArgs{
			Realm:   pulumi.String("my-realm"),
			Enabled: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		ldapUserFederation, err := ldap.NewUserFederation(ctx, "ldap_user_federation", &ldap.UserFederationArgs{
			Name:                  pulumi.String("openldap"),
			RealmId:               realm.ID(),
			UsernameLdapAttribute: pulumi.String("cn"),
			RdnLdapAttribute:      pulumi.String("cn"),
			UuidLdapAttribute:     pulumi.String("entryDN"),
			UserObjectClasses: pulumi.StringArray{
				pulumi.String("simpleSecurityObject"),
				pulumi.String("organizationalRole"),
			},
			ConnectionUrl:  pulumi.String("ldap://openldap"),
			UsersDn:        pulumi.String("dc=example,dc=org"),
			BindDn:         pulumi.String("cn=admin,dc=example,dc=org"),
			BindCredential: pulumi.String("admin"),
		})
		if err != nil {
			return err
		}
		_, err = ldap.NewUserAttributeMapper(ctx, "ldap_user_attribute_mapper", &ldap.UserAttributeMapperArgs{
			RealmId:              realm.ID(),
			LdapUserFederationId: ldapUserFederation.ID(),
			Name:                 pulumi.String("user-attribute-mapper"),
			UserModelAttribute:   pulumi.String("foo"),
			LdapAttribute:        pulumi.String("bar"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Keycloak = Pulumi.Keycloak;

return await Deployment.RunAsync(() => 
{
    var realm = new Keycloak.Realm("realm", new()
    {
        RealmName = "my-realm",
        Enabled = true,
    });

    var ldapUserFederation = new Keycloak.Ldap.UserFederation("ldap_user_federation", new()
    {
        Name = "openldap",
        RealmId = realm.Id,
        UsernameLdapAttribute = "cn",
        RdnLdapAttribute = "cn",
        UuidLdapAttribute = "entryDN",
        UserObjectClasses = new[]
        {
            "simpleSecurityObject",
            "organizationalRole",
        },
        ConnectionUrl = "ldap://openldap",
        UsersDn = "dc=example,dc=org",
        BindDn = "cn=admin,dc=example,dc=org",
        BindCredential = "admin",
    });

    var ldapUserAttributeMapper = new Keycloak.Ldap.UserAttributeMapper("ldap_user_attribute_mapper", new()
    {
        RealmId = realm.Id,
        LdapUserFederationId = ldapUserFederation.Id,
        Name = "user-attribute-mapper",
        UserModelAttribute = "foo",
        LdapAttribute = "bar",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.keycloak.Realm;
import com.pulumi.keycloak.RealmArgs;
import com.pulumi.keycloak.ldap.UserFederation;
import com.pulumi.keycloak.ldap.UserFederationArgs;
import com.pulumi.keycloak.ldap.UserAttributeMapper;
import com.pulumi.keycloak.ldap.UserAttributeMapperArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var realm = new Realm("realm", RealmArgs.builder()
            .realm("my-realm")
            .enabled(true)
            .build());

        var ldapUserFederation = new UserFederation("ldapUserFederation", UserFederationArgs.builder()
            .name("openldap")
            .realmId(realm.id())
            .usernameLdapAttribute("cn")
            .rdnLdapAttribute("cn")
            .uuidLdapAttribute("entryDN")
            .userObjectClasses(            
                "simpleSecurityObject",
                "organizationalRole")
            .connectionUrl("ldap://openldap")
            .usersDn("dc=example,dc=org")
            .bindDn("cn=admin,dc=example,dc=org")
            .bindCredential("admin")
            .build());

        var ldapUserAttributeMapper = new UserAttributeMapper("ldapUserAttributeMapper", UserAttributeMapperArgs.builder()
            .realmId(realm.id())
            .ldapUserFederationId(ldapUserFederation.id())
            .name("user-attribute-mapper")
            .userModelAttribute("foo")
            .ldapAttribute("bar")
            .build());

    }
}
Copy
resources:
  realm:
    type: keycloak:Realm
    properties:
      realm: my-realm
      enabled: true
  ldapUserFederation:
    type: keycloak:ldap:UserFederation
    name: ldap_user_federation
    properties:
      name: openldap
      realmId: ${realm.id}
      usernameLdapAttribute: cn
      rdnLdapAttribute: cn
      uuidLdapAttribute: entryDN
      userObjectClasses:
        - simpleSecurityObject
        - organizationalRole
      connectionUrl: ldap://openldap
      usersDn: dc=example,dc=org
      bindDn: cn=admin,dc=example,dc=org
      bindCredential: admin
  ldapUserAttributeMapper:
    type: keycloak:ldap:UserAttributeMapper
    name: ldap_user_attribute_mapper
    properties:
      realmId: ${realm.id}
      ldapUserFederationId: ${ldapUserFederation.id}
      name: user-attribute-mapper
      userModelAttribute: foo
      ldapAttribute: bar
Copy

Create UserAttributeMapper Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new UserAttributeMapper(name: string, args: UserAttributeMapperArgs, opts?: CustomResourceOptions);
@overload
def UserAttributeMapper(resource_name: str,
                        args: UserAttributeMapperArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def UserAttributeMapper(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        ldap_attribute: Optional[str] = None,
                        ldap_user_federation_id: Optional[str] = None,
                        realm_id: Optional[str] = None,
                        user_model_attribute: Optional[str] = None,
                        always_read_value_from_ldap: Optional[bool] = None,
                        attribute_default_value: Optional[str] = None,
                        attribute_force_default: Optional[bool] = None,
                        is_binary_attribute: Optional[bool] = None,
                        is_mandatory_in_ldap: Optional[bool] = None,
                        name: Optional[str] = None,
                        read_only: Optional[bool] = None)
func NewUserAttributeMapper(ctx *Context, name string, args UserAttributeMapperArgs, opts ...ResourceOption) (*UserAttributeMapper, error)
public UserAttributeMapper(string name, UserAttributeMapperArgs args, CustomResourceOptions? opts = null)
public UserAttributeMapper(String name, UserAttributeMapperArgs args)
public UserAttributeMapper(String name, UserAttributeMapperArgs args, CustomResourceOptions options)
type: keycloak:ldap:UserAttributeMapper
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UserAttributeMapperArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. UserAttributeMapperArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. UserAttributeMapperArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UserAttributeMapperArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. UserAttributeMapperArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var userAttributeMapperResource = new Keycloak.Ldap.UserAttributeMapper("userAttributeMapperResource", new()
{
    LdapAttribute = "string",
    LdapUserFederationId = "string",
    RealmId = "string",
    UserModelAttribute = "string",
    AlwaysReadValueFromLdap = false,
    AttributeDefaultValue = "string",
    AttributeForceDefault = false,
    IsBinaryAttribute = false,
    IsMandatoryInLdap = false,
    Name = "string",
    ReadOnly = false,
});
Copy
example, err := ldap.NewUserAttributeMapper(ctx, "userAttributeMapperResource", &ldap.UserAttributeMapperArgs{
	LdapAttribute:           pulumi.String("string"),
	LdapUserFederationId:    pulumi.String("string"),
	RealmId:                 pulumi.String("string"),
	UserModelAttribute:      pulumi.String("string"),
	AlwaysReadValueFromLdap: pulumi.Bool(false),
	AttributeDefaultValue:   pulumi.String("string"),
	AttributeForceDefault:   pulumi.Bool(false),
	IsBinaryAttribute:       pulumi.Bool(false),
	IsMandatoryInLdap:       pulumi.Bool(false),
	Name:                    pulumi.String("string"),
	ReadOnly:                pulumi.Bool(false),
})
Copy
var userAttributeMapperResource = new UserAttributeMapper("userAttributeMapperResource", UserAttributeMapperArgs.builder()
    .ldapAttribute("string")
    .ldapUserFederationId("string")
    .realmId("string")
    .userModelAttribute("string")
    .alwaysReadValueFromLdap(false)
    .attributeDefaultValue("string")
    .attributeForceDefault(false)
    .isBinaryAttribute(false)
    .isMandatoryInLdap(false)
    .name("string")
    .readOnly(false)
    .build());
Copy
user_attribute_mapper_resource = keycloak.ldap.UserAttributeMapper("userAttributeMapperResource",
    ldap_attribute="string",
    ldap_user_federation_id="string",
    realm_id="string",
    user_model_attribute="string",
    always_read_value_from_ldap=False,
    attribute_default_value="string",
    attribute_force_default=False,
    is_binary_attribute=False,
    is_mandatory_in_ldap=False,
    name="string",
    read_only=False)
Copy
const userAttributeMapperResource = new keycloak.ldap.UserAttributeMapper("userAttributeMapperResource", {
    ldapAttribute: "string",
    ldapUserFederationId: "string",
    realmId: "string",
    userModelAttribute: "string",
    alwaysReadValueFromLdap: false,
    attributeDefaultValue: "string",
    attributeForceDefault: false,
    isBinaryAttribute: false,
    isMandatoryInLdap: false,
    name: "string",
    readOnly: false,
});
Copy
type: keycloak:ldap:UserAttributeMapper
properties:
    alwaysReadValueFromLdap: false
    attributeDefaultValue: string
    attributeForceDefault: false
    isBinaryAttribute: false
    isMandatoryInLdap: false
    ldapAttribute: string
    ldapUserFederationId: string
    name: string
    readOnly: false
    realmId: string
    userModelAttribute: string
Copy

UserAttributeMapper Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The UserAttributeMapper resource accepts the following input properties:

LdapAttribute This property is required. string
Name of the mapped attribute on the LDAP object.
LdapUserFederationId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the LDAP user federation provider to attach this mapper to.
RealmId
This property is required.
Changes to this property will trigger replacement.
string
The realm that this LDAP mapper will exist in.
UserModelAttribute This property is required. string
Name of the user property or attribute you want to map the LDAP attribute into.
AlwaysReadValueFromLdap bool
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
AttributeDefaultValue string
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
AttributeForceDefault bool
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
IsBinaryAttribute bool
Should be true for binary LDAP attributes.
IsMandatoryInLdap bool
When true, this attribute must exist in LDAP. Defaults to false.
Name string
Display name of this mapper when displayed in the console.
ReadOnly bool
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
LdapAttribute This property is required. string
Name of the mapped attribute on the LDAP object.
LdapUserFederationId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the LDAP user federation provider to attach this mapper to.
RealmId
This property is required.
Changes to this property will trigger replacement.
string
The realm that this LDAP mapper will exist in.
UserModelAttribute This property is required. string
Name of the user property or attribute you want to map the LDAP attribute into.
AlwaysReadValueFromLdap bool
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
AttributeDefaultValue string
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
AttributeForceDefault bool
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
IsBinaryAttribute bool
Should be true for binary LDAP attributes.
IsMandatoryInLdap bool
When true, this attribute must exist in LDAP. Defaults to false.
Name string
Display name of this mapper when displayed in the console.
ReadOnly bool
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
ldapAttribute This property is required. String
Name of the mapped attribute on the LDAP object.
ldapUserFederationId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the LDAP user federation provider to attach this mapper to.
realmId
This property is required.
Changes to this property will trigger replacement.
String
The realm that this LDAP mapper will exist in.
userModelAttribute This property is required. String
Name of the user property or attribute you want to map the LDAP attribute into.
alwaysReadValueFromLdap Boolean
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attributeDefaultValue String
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attributeForceDefault Boolean
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
isBinaryAttribute Boolean
Should be true for binary LDAP attributes.
isMandatoryInLdap Boolean
When true, this attribute must exist in LDAP. Defaults to false.
name String
Display name of this mapper when displayed in the console.
readOnly Boolean
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
ldapAttribute This property is required. string
Name of the mapped attribute on the LDAP object.
ldapUserFederationId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the LDAP user federation provider to attach this mapper to.
realmId
This property is required.
Changes to this property will trigger replacement.
string
The realm that this LDAP mapper will exist in.
userModelAttribute This property is required. string
Name of the user property or attribute you want to map the LDAP attribute into.
alwaysReadValueFromLdap boolean
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attributeDefaultValue string
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attributeForceDefault boolean
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
isBinaryAttribute boolean
Should be true for binary LDAP attributes.
isMandatoryInLdap boolean
When true, this attribute must exist in LDAP. Defaults to false.
name string
Display name of this mapper when displayed in the console.
readOnly boolean
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
ldap_attribute This property is required. str
Name of the mapped attribute on the LDAP object.
ldap_user_federation_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the LDAP user federation provider to attach this mapper to.
realm_id
This property is required.
Changes to this property will trigger replacement.
str
The realm that this LDAP mapper will exist in.
user_model_attribute This property is required. str
Name of the user property or attribute you want to map the LDAP attribute into.
always_read_value_from_ldap bool
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attribute_default_value str
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attribute_force_default bool
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
is_binary_attribute bool
Should be true for binary LDAP attributes.
is_mandatory_in_ldap bool
When true, this attribute must exist in LDAP. Defaults to false.
name str
Display name of this mapper when displayed in the console.
read_only bool
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
ldapAttribute This property is required. String
Name of the mapped attribute on the LDAP object.
ldapUserFederationId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the LDAP user federation provider to attach this mapper to.
realmId
This property is required.
Changes to this property will trigger replacement.
String
The realm that this LDAP mapper will exist in.
userModelAttribute This property is required. String
Name of the user property or attribute you want to map the LDAP attribute into.
alwaysReadValueFromLdap Boolean
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attributeDefaultValue String
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attributeForceDefault Boolean
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
isBinaryAttribute Boolean
Should be true for binary LDAP attributes.
isMandatoryInLdap Boolean
When true, this attribute must exist in LDAP. Defaults to false.
name String
Display name of this mapper when displayed in the console.
readOnly Boolean
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the UserAttributeMapper resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing UserAttributeMapper Resource

Get an existing UserAttributeMapper resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: UserAttributeMapperState, opts?: CustomResourceOptions): UserAttributeMapper
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        always_read_value_from_ldap: Optional[bool] = None,
        attribute_default_value: Optional[str] = None,
        attribute_force_default: Optional[bool] = None,
        is_binary_attribute: Optional[bool] = None,
        is_mandatory_in_ldap: Optional[bool] = None,
        ldap_attribute: Optional[str] = None,
        ldap_user_federation_id: Optional[str] = None,
        name: Optional[str] = None,
        read_only: Optional[bool] = None,
        realm_id: Optional[str] = None,
        user_model_attribute: Optional[str] = None) -> UserAttributeMapper
func GetUserAttributeMapper(ctx *Context, name string, id IDInput, state *UserAttributeMapperState, opts ...ResourceOption) (*UserAttributeMapper, error)
public static UserAttributeMapper Get(string name, Input<string> id, UserAttributeMapperState? state, CustomResourceOptions? opts = null)
public static UserAttributeMapper get(String name, Output<String> id, UserAttributeMapperState state, CustomResourceOptions options)
resources:  _:    type: keycloak:ldap:UserAttributeMapper    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AlwaysReadValueFromLdap bool
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
AttributeDefaultValue string
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
AttributeForceDefault bool
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
IsBinaryAttribute bool
Should be true for binary LDAP attributes.
IsMandatoryInLdap bool
When true, this attribute must exist in LDAP. Defaults to false.
LdapAttribute string
Name of the mapped attribute on the LDAP object.
LdapUserFederationId Changes to this property will trigger replacement. string
The ID of the LDAP user federation provider to attach this mapper to.
Name string
Display name of this mapper when displayed in the console.
ReadOnly bool
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
RealmId Changes to this property will trigger replacement. string
The realm that this LDAP mapper will exist in.
UserModelAttribute string
Name of the user property or attribute you want to map the LDAP attribute into.
AlwaysReadValueFromLdap bool
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
AttributeDefaultValue string
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
AttributeForceDefault bool
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
IsBinaryAttribute bool
Should be true for binary LDAP attributes.
IsMandatoryInLdap bool
When true, this attribute must exist in LDAP. Defaults to false.
LdapAttribute string
Name of the mapped attribute on the LDAP object.
LdapUserFederationId Changes to this property will trigger replacement. string
The ID of the LDAP user federation provider to attach this mapper to.
Name string
Display name of this mapper when displayed in the console.
ReadOnly bool
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
RealmId Changes to this property will trigger replacement. string
The realm that this LDAP mapper will exist in.
UserModelAttribute string
Name of the user property or attribute you want to map the LDAP attribute into.
alwaysReadValueFromLdap Boolean
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attributeDefaultValue String
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attributeForceDefault Boolean
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
isBinaryAttribute Boolean
Should be true for binary LDAP attributes.
isMandatoryInLdap Boolean
When true, this attribute must exist in LDAP. Defaults to false.
ldapAttribute String
Name of the mapped attribute on the LDAP object.
ldapUserFederationId Changes to this property will trigger replacement. String
The ID of the LDAP user federation provider to attach this mapper to.
name String
Display name of this mapper when displayed in the console.
readOnly Boolean
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
realmId Changes to this property will trigger replacement. String
The realm that this LDAP mapper will exist in.
userModelAttribute String
Name of the user property or attribute you want to map the LDAP attribute into.
alwaysReadValueFromLdap boolean
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attributeDefaultValue string
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attributeForceDefault boolean
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
isBinaryAttribute boolean
Should be true for binary LDAP attributes.
isMandatoryInLdap boolean
When true, this attribute must exist in LDAP. Defaults to false.
ldapAttribute string
Name of the mapped attribute on the LDAP object.
ldapUserFederationId Changes to this property will trigger replacement. string
The ID of the LDAP user federation provider to attach this mapper to.
name string
Display name of this mapper when displayed in the console.
readOnly boolean
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
realmId Changes to this property will trigger replacement. string
The realm that this LDAP mapper will exist in.
userModelAttribute string
Name of the user property or attribute you want to map the LDAP attribute into.
always_read_value_from_ldap bool
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attribute_default_value str
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attribute_force_default bool
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
is_binary_attribute bool
Should be true for binary LDAP attributes.
is_mandatory_in_ldap bool
When true, this attribute must exist in LDAP. Defaults to false.
ldap_attribute str
Name of the mapped attribute on the LDAP object.
ldap_user_federation_id Changes to this property will trigger replacement. str
The ID of the LDAP user federation provider to attach this mapper to.
name str
Display name of this mapper when displayed in the console.
read_only bool
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
realm_id Changes to this property will trigger replacement. str
The realm that this LDAP mapper will exist in.
user_model_attribute str
Name of the user property or attribute you want to map the LDAP attribute into.
alwaysReadValueFromLdap Boolean
When true, the value fetched from LDAP will override the value stored in Keycloak. Defaults to false.
attributeDefaultValue String
Default value to set in LDAP if is_mandatory_in_ldap is true and the value is empty.
attributeForceDefault Boolean
When true, an empty default value is forced for mandatory attributes even when a default value is not specified. Defaults to true.
isBinaryAttribute Boolean
Should be true for binary LDAP attributes.
isMandatoryInLdap Boolean
When true, this attribute must exist in LDAP. Defaults to false.
ldapAttribute String
Name of the mapped attribute on the LDAP object.
ldapUserFederationId Changes to this property will trigger replacement. String
The ID of the LDAP user federation provider to attach this mapper to.
name String
Display name of this mapper when displayed in the console.
readOnly Boolean
When true, this attribute is not saved back to LDAP when the user attribute is updated in Keycloak. Defaults to false.
realmId Changes to this property will trigger replacement. String
The realm that this LDAP mapper will exist in.
userModelAttribute String
Name of the user property or attribute you want to map the LDAP attribute into.

Import

LDAP mappers can be imported using the format {{realm_id}}/{{ldap_user_federation_id}}/{{ldap_mapper_id}}.

The ID of the LDAP user federation provider and the mapper can be found within the Keycloak GUI, and they are typically GUIDs.

Example:

bash

$ pulumi import keycloak:ldap/userAttributeMapper:UserAttributeMapper ldap_user_attribute_mapper my-realm/af2a6ca3-e4d7-49c3-b08b-1b3c70b4b860/3d923ece-1a91-4bf7-adaf-3b82f2a12b67
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Keycloak pulumi/pulumi-keycloak
License
Apache-2.0
Notes
This Pulumi package is based on the keycloak Terraform Provider.