UserPropertyProtocolMapper

# keycloak.saml.UserPropertyProtocolMapper

Allows for creating and managing user property protocol mappers for SAML clients within Keycloak.

SAML user property protocol mappers allow you to map properties of the Keycloak user model to an attribute in a SAML assertion. Protocol mappers can be defined for a single client, or they can be defined for a client scope which can be shared between multiple different clients.

Example Usage (Client)

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

const realm = new keycloak.Realm("realm", {
    enabled: true,
    realm: "my-realm",
});
const samlClient = new keycloak.saml.Client("saml_client", {
    clientId: "test-saml-client",
    realmId: keycloak_realm_test.id,
});
const samlUserPropertyMapper = new keycloak.saml.UserPropertyProtocolMapper("saml_user_property_mapper", {
    clientId: samlClient.id,
    realmId: keycloak_realm_test.id,
    samlAttributeName: "email",
    samlAttributeNameFormat: "Unspecified",
    userProperty: "email",
});
import pulumi
import pulumi_keycloak as keycloak

realm = keycloak.Realm("realm",
    enabled=True,
    realm="my-realm")
saml_client = keycloak.saml.Client("samlClient",
    client_id="test-saml-client",
    realm_id=keycloak_realm["test"]["id"])
saml_user_property_mapper = keycloak.saml.UserPropertyProtocolMapper("samlUserPropertyMapper",
    client_id=saml_client.id,
    realm_id=keycloak_realm["test"]["id"],
    saml_attribute_name="email",
    saml_attribute_name_format="Unspecified",
    user_property="email")
using Pulumi;
using Keycloak = Pulumi.Keycloak;

class MyStack : Stack
{
    public MyStack()
    {
        var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
        {
            Enabled = true,
            Realm = "my-realm",
        });
        var samlClient = new Keycloak.Saml.Client("samlClient", new Keycloak.Saml.ClientArgs
        {
            ClientId = "test-saml-client",
            RealmId = keycloak_realm.Test.Id,
        });
        var samlUserPropertyMapper = new Keycloak.Saml.UserPropertyProtocolMapper("samlUserPropertyMapper", new Keycloak.Saml.UserPropertyProtocolMapperArgs
        {
            ClientId = samlClient.Id,
            RealmId = keycloak_realm.Test.Id,
            SamlAttributeName = "email",
            SamlAttributeNameFormat = "Unspecified",
            UserProperty = "email",
        });
    }

}

Argument Reference

The following arguments are supported:

  • realm_id - (Required) The realm this protocol mapper exists within.
  • client_id - (Required if client_scope_id is not specified) The SAML client this protocol mapper is attached to.
  • client_scope_id - (Required if client_id is not specified) The SAML client scope this protocol mapper is attached to.
  • name - (Required) The display name of this protocol mapper in the GUI.
  • user_property - (Required) The property of the Keycloak user model to map.
  • friendly_name - (Optional) An optional human-friendly name for this attribute.
  • saml_attribute_name - (Required) The name of the SAML attribute.
  • saml_attribute_name_format - (Required) The SAML attribute Name Format. Can be one of Unspecified, Basic, or URI Reference.

Create a UserPropertyProtocolMapper Resource

def UserPropertyProtocolMapper(resource_name, opts=None, client_id=None, client_scope_id=None, friendly_name=None, name=None, realm_id=None, saml_attribute_name=None, saml_attribute_name_format=None, user_property=None, __props__=None);
name string
The unique name of the resource.
args UserPropertyProtocolMapperArgs
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 UserPropertyProtocolMapperArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args UserPropertyProtocolMapperArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

UserPropertyProtocolMapper Resource Properties

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

Inputs

The UserPropertyProtocolMapper resource accepts the following input properties:

RealmId string
SamlAttributeName string
SamlAttributeNameFormat string
UserProperty string
ClientId string
ClientScopeId string
FriendlyName string
Name string
RealmId string
SamlAttributeName string
SamlAttributeNameFormat string
UserProperty string
ClientId string
ClientScopeId string
FriendlyName string
Name string
realmId string
samlAttributeName string
samlAttributeNameFormat string
userProperty string
clientId string
clientScopeId string
friendlyName string
name string
realm_id str
saml_attribute_name str
saml_attribute_name_format str
user_property str
client_id str
client_scope_id str
friendly_name str
name str

Outputs

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

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

static get(resource_name, id, opts=None, client_id=None, client_scope_id=None, friendly_name=None, name=None, realm_id=None, saml_attribute_name=None, saml_attribute_name_format=None, user_property=None, __props__=None);
func GetUserPropertyProtocolMapper(ctx *Context, name string, id IDInput, state *UserPropertyProtocolMapperState, opts ...ResourceOption) (*UserPropertyProtocolMapper, 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:

ClientId string
ClientScopeId string
FriendlyName string
Name string
RealmId string
SamlAttributeName string
SamlAttributeNameFormat string
UserProperty string
ClientId string
ClientScopeId string
FriendlyName string
Name string
RealmId string
SamlAttributeName string
SamlAttributeNameFormat string
UserProperty string
clientId string
clientScopeId string
friendlyName string
name string
realmId string
samlAttributeName string
samlAttributeNameFormat string
userProperty string
client_id str
client_scope_id str
friendly_name str
name str
realm_id str
saml_attribute_name str
saml_attribute_name_format str
user_property str

Package Details

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