Class HardcodedRoleMapper
# keycloak.ldap.HardcodedRoleMapper
This mapper will grant a specified Keycloak role to each Keycloak user linked with LDAP.
Example Usage
using Pulumi;
using Keycloak = Pulumi.Keycloak;
class MyStack : Stack
{
public MyStack()
{
var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
{
Realm = "test",
Enabled = true,
});
var ldapUserFederation = new Keycloak.Ldap.UserFederation("ldapUserFederation", new Keycloak.Ldap.UserFederationArgs
{
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",
});
var assignAdminRoleToAllUsers = new Keycloak.Ldap.HardcodedRoleMapper("assignAdminRoleToAllUsers", new Keycloak.Ldap.HardcodedRoleMapperArgs
{
RealmId = realm.Id,
LdapUserFederationId = ldapUserFederation.Id,
Role = "admin",
});
}
}
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.role- (Required) The role which should be assigned to the users.
Inherited Members
Namespace: Pulumi.Keycloak.Ldap
Assembly: Pulumi.Keycloak.dll
Syntax
public class HardcodedRoleMapper : CustomResource
Constructors
View SourceHardcodedRoleMapper(String, HardcodedRoleMapperArgs, CustomResourceOptions)
Create a HardcodedRoleMapper resource with the given unique name, arguments, and options.
Declaration
public HardcodedRoleMapper(string name, HardcodedRoleMapperArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| HardcodedRoleMapperArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceLdapUserFederationId
The ldap user federation provider to attach this mapper to.
Declaration
public Output<string> LdapUserFederationId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Display name of the mapper when displayed in the console.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RealmId
The realm in which the ldap user federation provider exists.
Declaration
public Output<string> RealmId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Role
Role to grant to user.
Declaration
public Output<string> Role { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, HardcodedRoleMapperState, CustomResourceOptions)
Get an existing HardcodedRoleMapper resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static HardcodedRoleMapper Get(string name, Input<string> id, HardcodedRoleMapperState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| HardcodedRoleMapperState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| HardcodedRoleMapper |