MsadUserAccountControlMapper

# keycloak.ldap.MsadUserAccountControlMapper

Allows for creating and managing MSAD user account control mappers for Keycloak users federated via LDAP.

The MSAD (Microsoft Active Directory) user account control mapper is specific to LDAP user federation providers that are pulling from AD, and it can propagate AD user state to Keycloak in order to enforce settings like expired passwords or disabled accounts.

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://my-ad-server",
    rdnLdapAttribute: "cn",
    realmId: realm.id,
    userObjectClasses: [
        "person",
        "organizationalPerson",
        "user",
    ],
    usernameLdapAttribute: "cn",
    usersDn: "dc=example,dc=org",
    uuidLdapAttribute: "objectGUID",
});
const msadUserAccountControlMapper = new keycloak.ldap.MsadUserAccountControlMapper("msad_user_account_control_mapper", {
    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://my-ad-server",
    rdn_ldap_attribute="cn",
    realm_id=realm.id,
    user_object_classes=[
        "person",
        "organizationalPerson",
        "user",
    ],
    username_ldap_attribute="cn",
    users_dn="dc=example,dc=org",
    uuid_ldap_attribute="objectGUID")
msad_user_account_control_mapper = keycloak.ldap.MsadUserAccountControlMapper("msadUserAccountControlMapper",
    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://my-ad-server",
            RdnLdapAttribute = "cn",
            RealmId = realm.Id,
            UserObjectClasses = 
            {
                "person",
                "organizationalPerson",
                "user",
            },
            UsernameLdapAttribute = "cn",
            UsersDn = "dc=example,dc=org",
            UuidLdapAttribute = "objectGUID",
        });
        var msadUserAccountControlMapper = new Keycloak.Ldap.MsadUserAccountControlMapper("msadUserAccountControlMapper", new Keycloak.Ldap.MsadUserAccountControlMapperArgs
        {
            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_password_policy_hints_enabled - (Optional) When true, advanced password policies, such as password hints and previous password history will be used when writing new passwords to AD. Defaults to false.

Create a MsadUserAccountControlMapper Resource

def MsadUserAccountControlMapper(resource_name, opts=None, ldap_password_policy_hints_enabled=None, ldap_user_federation_id=None, name=None, realm_id=None, __props__=None);
name string
The unique name of the resource.
args MsadUserAccountControlMapperArgs
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 MsadUserAccountControlMapperArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MsadUserAccountControlMapperArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MsadUserAccountControlMapper Resource Properties

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

Inputs

The MsadUserAccountControlMapper resource accepts the following input properties:

LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

RealmId string

The realm in which the ldap user federation provider exists.

LdapPasswordPolicyHintsEnabled bool
Name string

Display name of the mapper when displayed in the console.

LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

RealmId string

The realm in which the ldap user federation provider exists.

LdapPasswordPolicyHintsEnabled bool
Name string

Display name of the mapper when displayed in the console.

ldapUserFederationId string

The ldap user federation provider to attach this mapper to.

realmId string

The realm in which the ldap user federation provider exists.

ldapPasswordPolicyHintsEnabled boolean
name string

Display name of the mapper when displayed in the console.

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.

ldap_password_policy_hints_enabled bool
name str

Display name of the mapper when displayed in the console.

Outputs

All input properties are implicitly available as output properties. Additionally, the MsadUserAccountControlMapper 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 MsadUserAccountControlMapper Resource

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

static get(resource_name, id, opts=None, ldap_password_policy_hints_enabled=None, ldap_user_federation_id=None, name=None, realm_id=None, __props__=None);
func GetMsadUserAccountControlMapper(ctx *Context, name string, id IDInput, state *MsadUserAccountControlMapperState, opts ...ResourceOption) (*MsadUserAccountControlMapper, error)
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:

LdapPasswordPolicyHintsEnabled bool
LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

Name string

Display name of the mapper when displayed in the console.

RealmId string

The realm in which the ldap user federation provider exists.

LdapPasswordPolicyHintsEnabled bool
LdapUserFederationId string

The ldap user federation provider to attach this mapper to.

Name string

Display name of the mapper when displayed in the console.

RealmId string

The realm in which the ldap user federation provider exists.

ldapPasswordPolicyHintsEnabled boolean
ldapUserFederationId string

The ldap user federation provider to attach this mapper to.

name string

Display name of the mapper when displayed in the console.

realmId string

The realm in which the ldap user federation provider exists.

ldap_password_policy_hints_enabled bool
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.

realm_id str

The realm in which the ldap user federation provider exists.

Package Details

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