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
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-client",
realmId: realm.id,
});
const samlHardcodeAttributeMapper = new keycloak.GenericClientProtocolMapper("saml_hardcode_attribute_mapper", {
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,
});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-client",
realm_id=realm.id)
saml_hardcode_attribute_mapper = keycloak.GenericClientProtocolMapper("samlHardcodeAttributeMapper",
client_id=saml_client.id,
config={
"attribute.name": "name",
"attribute.nameformat": "Basic",
"attribute.value": "value",
"friendly.name": "display name",
},
protocol="saml",
protocol_mapper="saml-hardcode-attribute-mapper",
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 = "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.
Create a GenericClientProtocolMapper Resource
new GenericClientProtocolMapper(name: string, args: GenericClientProtocolMapperArgs, opts?: CustomResourceOptions);def GenericClientProtocolMapper(resource_name, opts=None, client_id=None, client_scope_id=None, config=None, name=None, protocol=None, protocol_mapper=None, realm_id=None, __props__=None);func NewGenericClientProtocolMapper(ctx *Context, name string, args GenericClientProtocolMapperArgs, opts ...ResourceOption) (*GenericClientProtocolMapper, error)public GenericClientProtocolMapper(string name, GenericClientProtocolMapperArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args GenericClientProtocolMapperArgs
- 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 GenericClientProtocolMapperArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GenericClientProtocolMapperArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
GenericClientProtocolMapper Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The GenericClientProtocolMapper resource accepts the following input properties:
- Config Dictionary<string, object>
- Protocol string
The protocol of the client (openid-connect / saml).
- Protocol
Mapper string The type of the protocol mapper.
- Realm
Id string The realm id where the associated client or client scope exists.
- Client
Id string The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- Client
Scope stringId The mapper’s associated client scope. Cannot be used at the same time as client_id.
- Name string
A human-friendly name that will appear in the Keycloak console.
- Config map[string]interface{}
- Protocol string
The protocol of the client (openid-connect / saml).
- Protocol
Mapper string The type of the protocol mapper.
- Realm
Id string The realm id where the associated client or client scope exists.
- Client
Id string The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- Client
Scope stringId The mapper’s associated client scope. Cannot be used at the same time as client_id.
- Name string
A human-friendly name that will appear in the Keycloak console.
- config {[key: string]: any}
- protocol string
The protocol of the client (openid-connect / saml).
- protocol
Mapper string The type of the protocol mapper.
- realm
Id string The realm id where the associated client or client scope exists.
- client
Id string The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- client
Scope stringId The mapper’s associated client scope. Cannot be used at the same time as client_id.
- name string
A human-friendly name that will appear in the Keycloak console.
- config Dict[str, Any]
- protocol str
The protocol of the client (openid-connect / saml).
- protocol_
mapper str The type of the protocol mapper.
- realm_
id str The realm id where the associated client or client scope exists.
- client_
id str The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- client_
scope_ strid The mapper’s associated client scope. Cannot be used at the same time as client_id.
- name str
A human-friendly name that will appear in the Keycloak console.
Outputs
All input properties are implicitly available as output properties. Additionally, the GenericClientProtocolMapper resource produces the following output properties:
Look up an Existing GenericClientProtocolMapper Resource
Get an existing GenericClientProtocolMapper resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GenericClientProtocolMapperState, opts?: CustomResourceOptions): GenericClientProtocolMapperstatic get(resource_name, id, opts=None, client_id=None, client_scope_id=None, config=None, name=None, protocol=None, protocol_mapper=None, realm_id=None, __props__=None);func GetGenericClientProtocolMapper(ctx *Context, name string, id IDInput, state *GenericClientProtocolMapperState, opts ...ResourceOption) (*GenericClientProtocolMapper, error)public static GenericClientProtocolMapper Get(string name, Input<string> id, GenericClientProtocolMapperState? state, CustomResourceOptions? opts = null)- 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:
- Client
Id string The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- Client
Scope stringId The mapper’s associated client scope. Cannot be used at the same time as client_id.
- Config Dictionary<string, object>
- Name string
A human-friendly name that will appear in the Keycloak console.
- Protocol string
The protocol of the client (openid-connect / saml).
- Protocol
Mapper string The type of the protocol mapper.
- Realm
Id string The realm id where the associated client or client scope exists.
- Client
Id string The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- Client
Scope stringId The mapper’s associated client scope. Cannot be used at the same time as client_id.
- Config map[string]interface{}
- Name string
A human-friendly name that will appear in the Keycloak console.
- Protocol string
The protocol of the client (openid-connect / saml).
- Protocol
Mapper string The type of the protocol mapper.
- Realm
Id string The realm id where the associated client or client scope exists.
- client
Id string The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- client
Scope stringId The mapper’s associated client scope. Cannot be used at the same time as client_id.
- config {[key: string]: any}
- name string
A human-friendly name that will appear in the Keycloak console.
- protocol string
The protocol of the client (openid-connect / saml).
- protocol
Mapper string The type of the protocol mapper.
- realm
Id string The realm id where the associated client or client scope exists.
- client_
id str The mapper’s associated client. Cannot be used at the same time as client_scope_id.
- client_
scope_ strid The mapper’s associated client scope. Cannot be used at the same time as client_id.
- config Dict[str, Any]
- name str
A human-friendly name that will appear in the Keycloak console.
- protocol str
The protocol of the client (openid-connect / saml).
- protocol_
mapper str The type of the protocol mapper.
- realm_
id str The realm id where the associated client or client scope exists.
Package Details
- Repository
- https://github.com/pulumi/pulumi-keycloak
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
keycloakTerraform Provider.