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) Whentrue, updates to a user within Keycloak will not be written back to LDAP. Defaults tofalse.write_only- (Optional) Whentrue, this mapper will only be used to write updates to LDAP. Defaults tofalse.
Create a FullNameMapper Resource
new FullNameMapper(name: string, args: FullNameMapperArgs, opts?: CustomResourceOptions);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);func NewFullNameMapper(ctx *Context, name string, args FullNameMapperArgs, opts ...ResourceOption) (*FullNameMapper, error)public FullNameMapper(string name, FullNameMapperArgs args, CustomResourceOptions? opts = null)- 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:
- ldap_
full_ strname_ attribute - ldap_
user_ strfederation_ id 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:
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): FullNameMapperstatic 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:
- ldap_
full_ strname_ attribute - ldap_
user_ strfederation_ id 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
keycloakTerraform Provider.