1. Packages
  2. Packages
  3. Keycloak Provider
  4. API Docs
  5. getGenericProtocolMapper
Viewing docs for Keycloak v6.12.0
published on Saturday, Jun 6, 2026 by Pulumi
keycloak logo
Viewing docs for Keycloak v6.12.0
published on Saturday, Jun 6, 2026 by Pulumi

    This data source can be used to fetch properties of a protocol mapper attached to a client or client scope.

    This is useful for importing auto-created protocol mappers (such as the organization membership mapper) into Terraform state by looking up their ID by name.

    Using getGenericProtocolMapper

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getGenericProtocolMapper(args: GetGenericProtocolMapperArgs, opts?: InvokeOptions): Promise<GetGenericProtocolMapperResult>
    function getGenericProtocolMapperOutput(args: GetGenericProtocolMapperOutputArgs, opts?: InvokeOptions): Output<GetGenericProtocolMapperResult>
    def get_generic_protocol_mapper(client_id: Optional[str] = None,
                                    client_scope_id: Optional[str] = None,
                                    name: Optional[str] = None,
                                    realm_id: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetGenericProtocolMapperResult
    def get_generic_protocol_mapper_output(client_id: pulumi.Input[Optional[str]] = None,
                                    client_scope_id: pulumi.Input[Optional[str]] = None,
                                    name: pulumi.Input[Optional[str]] = None,
                                    realm_id: pulumi.Input[Optional[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetGenericProtocolMapperResult]
    func LookupGenericProtocolMapper(ctx *Context, args *LookupGenericProtocolMapperArgs, opts ...InvokeOption) (*LookupGenericProtocolMapperResult, error)
    func LookupGenericProtocolMapperOutput(ctx *Context, args *LookupGenericProtocolMapperOutputArgs, opts ...InvokeOption) LookupGenericProtocolMapperResultOutput

    > Note: This function is named LookupGenericProtocolMapper in the Go SDK.

    public static class GetGenericProtocolMapper 
    {
        public static Task<GetGenericProtocolMapperResult> InvokeAsync(GetGenericProtocolMapperArgs args, InvokeOptions? opts = null)
        public static Output<GetGenericProtocolMapperResult> Invoke(GetGenericProtocolMapperInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGenericProtocolMapperResult> getGenericProtocolMapper(GetGenericProtocolMapperArgs args, InvokeOptions options)
    public static Output<GetGenericProtocolMapperResult> getGenericProtocolMapper(GetGenericProtocolMapperArgs args, InvokeOptions options)
    
    fn::invoke:
      function: keycloak:index/getGenericProtocolMapper:getGenericProtocolMapper
      arguments:
        # arguments dictionary
    data "keycloak_getgenericprotocolmapper" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    The name of the protocol mapper to look up.
    RealmId string
    The realm this protocol mapper exists within.
    ClientId string
    The client this protocol mapper is attached to. Conflicts with clientScopeId.
    ClientScopeId string

    The client scope this protocol mapper is attached to. Conflicts with clientId.

    One of clientId or clientScopeId must be specified.

    Name string
    The name of the protocol mapper to look up.
    RealmId string
    The realm this protocol mapper exists within.
    ClientId string
    The client this protocol mapper is attached to. Conflicts with clientScopeId.
    ClientScopeId string

    The client scope this protocol mapper is attached to. Conflicts with clientId.

    One of clientId or clientScopeId must be specified.

    name string
    The name of the protocol mapper to look up.
    realm_id string
    The realm this protocol mapper exists within.
    client_id string
    The client this protocol mapper is attached to. Conflicts with clientScopeId.
    client_scope_id string

    The client scope this protocol mapper is attached to. Conflicts with clientId.

    One of clientId or clientScopeId must be specified.

    name String
    The name of the protocol mapper to look up.
    realmId String
    The realm this protocol mapper exists within.
    clientId String
    The client this protocol mapper is attached to. Conflicts with clientScopeId.
    clientScopeId String

    The client scope this protocol mapper is attached to. Conflicts with clientId.

    One of clientId or clientScopeId must be specified.

    name string
    The name of the protocol mapper to look up.
    realmId string
    The realm this protocol mapper exists within.
    clientId string
    The client this protocol mapper is attached to. Conflicts with clientScopeId.
    clientScopeId string

    The client scope this protocol mapper is attached to. Conflicts with clientId.

    One of clientId or clientScopeId must be specified.

    name str
    The name of the protocol mapper to look up.
    realm_id str
    The realm this protocol mapper exists within.
    client_id str
    The client this protocol mapper is attached to. Conflicts with clientScopeId.
    client_scope_id str

    The client scope this protocol mapper is attached to. Conflicts with clientId.

    One of clientId or clientScopeId must be specified.

    name String
    The name of the protocol mapper to look up.
    realmId String
    The realm this protocol mapper exists within.
    clientId String
    The client this protocol mapper is attached to. Conflicts with clientScopeId.
    clientScopeId String

    The client scope this protocol mapper is attached to. Conflicts with clientId.

    One of clientId or clientScopeId must be specified.

    getGenericProtocolMapper Result

    The following output properties are available:

    Config Dictionary<string, string>
    A map of configuration values for the protocol mapper.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Protocol string
    The protocol of the mapper (e.g., openid-connect or saml).
    ProtocolMapper string
    The type of the protocol mapper (e.g., oidc-organization-membership-mapper).
    RealmId string
    ClientId string
    ClientScopeId string
    Config map[string]string
    A map of configuration values for the protocol mapper.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Protocol string
    The protocol of the mapper (e.g., openid-connect or saml).
    ProtocolMapper string
    The type of the protocol mapper (e.g., oidc-organization-membership-mapper).
    RealmId string
    ClientId string
    ClientScopeId string
    config map(string)
    A map of configuration values for the protocol mapper.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    protocol string
    The protocol of the mapper (e.g., openid-connect or saml).
    protocol_mapper string
    The type of the protocol mapper (e.g., oidc-organization-membership-mapper).
    realm_id string
    client_id string
    client_scope_id string
    config Map<String,String>
    A map of configuration values for the protocol mapper.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    protocol String
    The protocol of the mapper (e.g., openid-connect or saml).
    protocolMapper String
    The type of the protocol mapper (e.g., oidc-organization-membership-mapper).
    realmId String
    clientId String
    clientScopeId String
    config {[key: string]: string}
    A map of configuration values for the protocol mapper.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    protocol string
    The protocol of the mapper (e.g., openid-connect or saml).
    protocolMapper string
    The type of the protocol mapper (e.g., oidc-organization-membership-mapper).
    realmId string
    clientId string
    clientScopeId string
    config Mapping[str, str]
    A map of configuration values for the protocol mapper.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    protocol str
    The protocol of the mapper (e.g., openid-connect or saml).
    protocol_mapper str
    The type of the protocol mapper (e.g., oidc-organization-membership-mapper).
    realm_id str
    client_id str
    client_scope_id str
    config Map<String>
    A map of configuration values for the protocol mapper.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    protocol String
    The protocol of the mapper (e.g., openid-connect or saml).
    protocolMapper String
    The type of the protocol mapper (e.g., oidc-organization-membership-mapper).
    realmId String
    clientId String
    clientScopeId String

    Package Details

    Repository
    Keycloak pulumi/pulumi-keycloak
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the keycloak Terraform Provider.
    keycloak logo
    Viewing docs for Keycloak v6.12.0
    published on Saturday, Jun 6, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial