Show / Hide Table of Contents

Class GenericClientProtocolMapper

# keycloak..GenericClientProtocolMapper

Allows for creating and managing protocol mapper for both types of clients (openid-connect and saml) within Keycloak.

There are two uses cases for using this resource:

  • If you implemented a custom protocol mapper, this resource can be used to configure it
  • If the provider doesn't support a particular protocol mapper, this resource can be used instead.

Due to the generic nature of this mapper, it is less user-friendly and more prone to configuration errors. Therefore, if possible, a specific mapper should be used.

Example Usage

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-client",
        RealmId = realm.Id,
    });
    var samlHardcodeAttributeMapper = new Keycloak.GenericClientProtocolMapper("samlHardcodeAttributeMapper", new Keycloak.GenericClientProtocolMapperArgs
    {
        ClientId = samlClient.Id,
        Config = 
        {
            { "attribute.name", "name" },
            { "attribute.nameformat", "Basic" },
            { "attribute.value", "value" },
            { "friendly.name", "display name" },
        },
        Protocol = "saml",
        ProtocolMapper = "saml-hardcode-attribute-mapper",
        RealmId = realm.Id,
    });
}

}

Argument Reference

The following arguments are supported:

  • realm_id - (Required) The realm this protocol mapper exists within.
  • client_id - (Required) The client this protocol mapper is attached to.
  • name - (Required) The display name of this protocol mapper in the GUI.
  • protocol - (Required) The type of client (either openid-connect or saml). The type must match the type of the client.
  • protocol_mapper - (Required) The name of the protocol mapper. The protocol mapper must be compatible with the specified client.
  • config - (Required) A map with key / value pairs for configuring the protocol mapper. The supported keys depends on the protocol mapper.
Inheritance
System.Object
Resource
CustomResource
GenericClientProtocolMapper
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Keycloak
Assembly: Pulumi.Keycloak.dll
Syntax
public class GenericClientProtocolMapper : CustomResource

Constructors

View Source

GenericClientProtocolMapper(String, GenericClientProtocolMapperArgs, CustomResourceOptions)

Create a GenericClientProtocolMapper resource with the given unique name, arguments, and options.

Declaration
public GenericClientProtocolMapper(string name, GenericClientProtocolMapperArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

GenericClientProtocolMapperArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ClientId

The mapper's associated client. Cannot be used at the same time as client_scope_id.

Declaration
public Output<string> ClientId { get; }
Property Value
Type Description
Output<System.String>
View Source

ClientScopeId

The mapper's associated client scope. Cannot be used at the same time as client_id.

Declaration
public Output<string> ClientScopeId { get; }
Property Value
Type Description
Output<System.String>
View Source

Config

Declaration
public Output<ImmutableDictionary<string, object>> Config { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

Name

A human-friendly name that will appear in the Keycloak console.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Protocol

The protocol of the client (openid-connect / saml).

Declaration
public Output<string> Protocol { get; }
Property Value
Type Description
Output<System.String>
View Source

ProtocolMapper

The type of the protocol mapper.

Declaration
public Output<string> ProtocolMapper { get; }
Property Value
Type Description
Output<System.String>
View Source

RealmId

The realm id where the associated client or client scope exists.

Declaration
public Output<string> RealmId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, GenericClientProtocolMapperState, CustomResourceOptions)

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

Declaration
public static GenericClientProtocolMapper Get(string name, Input<string> id, GenericClientProtocolMapperState 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.

GenericClientProtocolMapperState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
GenericClientProtocolMapper
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.