FullNameMapper

# keycloak.ldap.FullNameMapper

Allows for creating and managing full name mappers for Keycloak users federated via LDAP.

The LDAP full name mapper can map a user’s full name from an LDAP attribute to the first and last name attributes of a Keycloak user.

Example Usage

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

const realm = new keycloak.Realm("realm", {
    enabled: true,
    realm: "test",
});
const ldapUserFederation = new keycloak.ldap.UserFederation("ldap_user_federation", {
    bindCredential: "admin",
    bindDn: "cn=admin,dc=example,dc=org",
    connectionUrl: "ldap://openldap",
    rdnLdapAttribute: "cn",
    realmId: realm.id,
    userObjectClasses: [
        "simpleSecurityObject",
        "organizationalRole",
    ],
    usernameLdapAttribute: "cn",
    usersDn: "dc=example,dc=org",
    uuidLdapAttribute: "entryDN",
});
const ldapFullNameMapper = new keycloak.ldap.FullNameMapper("ldap_full_name_mapper", {
    ldapFullNameAttribute: "cn",
    ldapUserFederationId: ldapUserFederation.id,
    realmId: realm.id,
});
import pulumi
import pulumi_keycloak as keycloak

realm = keycloak.Realm("realm",
    enabled=True,
    realm="test")
ldap_user_federation = keycloak.ldap.UserFederation("ldapUserFederation",
    bind_credential="admin",
    bind_dn="cn=admin,dc=example,dc=org",
    connection_url="ldap://openldap",
    rdn_ldap_attribute="cn",
    realm_id=realm.id,
    user_object_classes=[
        "simpleSecurityObject",
        "organizationalRole",
    ],
    username_ldap_attribute="cn",
    users_dn="dc=example,dc=org",
    uuid_ldap_attribute="entryDN")
ldap_full_name_mapper = keycloak.ldap.FullNameMapper("ldapFullNameMapper",
    ldap_full_name_attribute="cn",
    ldap_user_federation_id=ldap_user_federation.id,
    realm_id=realm.id)
using Pulumi;
using Keycloak = Pulumi.Keycloak;

class MyStack : Stack
{
    public MyStack()
    {
        var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
        {
            Enabled = true,
            Realm = "test",
        });
        var ldapUserFederation = new Keycloak.Ldap.UserFederation("ldapUserFederation", new Keycloak.Ldap.UserFederationArgs
        {
            BindCredential = "admin",
            BindDn = "cn=admin,dc=example,dc=org",
            ConnectionUrl = "ldap://openldap",
            RdnLdapAttribute = "cn",
            RealmId = realm.Id,
            UserObjectClasses = 
            {
                "simpleSecurityObject",
                "organizationalRole",
            },
            UsernameLdapAttribute = "cn",
            UsersDn = "dc=example,dc=org",
            UuidLdapAttribute = "entryDN",
        });
        var ldapFullNameMapper = new Keycloak.Ldap.FullNameMapper("ldapFullNameMapper", new Keycloak.Ldap.FullNameMapperArgs
        {
            LdapFullNameAttribute = "cn",
            LdapUserFederationId = ldapUserFederation.Id,
            RealmId = realm.Id,
        });
    }

}

Argument Reference

The following arguments are supported:

  • realm_id - (Required) The realm that this LDAP mapper will exist in.
  • ldap_user_federation_id - (Required) The ID of the LDAP user federation provider to attach this mapper to.
  • name - (Required) Display name of this mapper when displayed in the console.
  • ldap_full_name_attribute - (Required) The name of the LDAP attribute containing the user’s full name.
  • read_only - (Optional) When true, updates to a user within Keycloak will not be written back to LDAP. Defaults to false.
  • write_only - (Optional) When true, this mapper will only be used to write updates to LDAP. Defaults to false.

Create a FullNameMapper Resource

def FullNameMapper(resource_name, opts=None, ldap_full_name_attribute=None, ldap_user_federation_id=None, name=None, read_only=None, realm_id=None, write_only=None, __props__=None);
name string
The unique name of the resource.
args FullNameMapperArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FullNameMapperArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FullNameMapperArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

FullNameMapper Resource Properties

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

Inputs

The FullNameMapper resource accepts the following input properties:

LdapFullNameAttribute string
LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

RealmId string

The realm in which the ldap user federation provider exists.

Name string

Display name of the mapper when displayed in the console.

ReadOnly bool
WriteOnly bool
LdapFullNameAttribute string
LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

RealmId string

The realm in which the ldap user federation provider exists.

Name string

Display name of the mapper when displayed in the console.

ReadOnly bool
WriteOnly bool
ldapFullNameAttribute string
ldapUserFederationId string

The ldap user federation provider to attach this mapper to.

realmId string

The realm in which the ldap user federation provider exists.

name string

Display name of the mapper when displayed in the console.

readOnly boolean
writeOnly boolean
ldap_full_name_attribute str
ldap_user_federation_id str

The ldap user federation provider to attach this mapper to.

realm_id str

The realm in which the ldap user federation provider exists.

name str

Display name of the mapper when displayed in the console.

read_only bool
write_only bool

Outputs

All input properties are implicitly available as output properties. Additionally, the FullNameMapper 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing FullNameMapper Resource

Get an existing FullNameMapper 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?: FullNameMapperState, opts?: CustomResourceOptions): FullNameMapper
static get(resource_name, id, opts=None, ldap_full_name_attribute=None, ldap_user_federation_id=None, name=None, read_only=None, realm_id=None, write_only=None, __props__=None);
func GetFullNameMapper(ctx *Context, name string, id IDInput, state *FullNameMapperState, opts ...ResourceOption) (*FullNameMapper, error)
public static FullNameMapper Get(string name, Input<string> id, FullNameMapperState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:

LdapFullNameAttribute string
LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

Name string

Display name of the mapper when displayed in the console.

ReadOnly bool
RealmId string

The realm in which the ldap user federation provider exists.

WriteOnly bool
LdapFullNameAttribute string
LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

Name string

Display name of the mapper when displayed in the console.

ReadOnly bool
RealmId string

The realm in which the ldap user federation provider exists.

WriteOnly bool
ldapFullNameAttribute string
ldapUserFederationId string

The ldap user federation provider to attach this mapper to.

name string

Display name of the mapper when displayed in the console.

readOnly boolean
realmId string

The realm in which the ldap user federation provider exists.

writeOnly boolean
ldap_full_name_attribute str
ldap_user_federation_id str

The ldap user federation provider to attach this mapper to.

name str

Display name of the mapper when displayed in the console.

read_only bool
realm_id str

The realm in which the ldap user federation provider exists.

write_only bool

Package Details

Repository
https://github.com/pulumi/pulumi-keycloak
License
Apache-2.0
Notes
This Pulumi package is based on the keycloak Terraform Provider.