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 (eitheropenid-connectorsaml). 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.
Inherited Members
Namespace: Pulumi.Keycloak
Assembly: Pulumi.Keycloak.dll
Syntax
public class GenericClientProtocolMapper : CustomResource
Constructors
View SourceGenericClientProtocolMapper(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 SourceClientId
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> |
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> |
Config
Declaration
public Output<ImmutableDictionary<string, object>> Config { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
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> |
Protocol
The protocol of the client (openid-connect / saml).
Declaration
public Output<string> Protocol { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ProtocolMapper
The type of the protocol mapper.
Declaration
public Output<string> ProtocolMapper { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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 SourceGet(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 |