Attribute Importer Identity Provider Mapper
# keycloak.AttributeImporterIdentityProviderMapper
Allows to create and manage identity provider mappers within Keycloak.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";
const testMapper = new keycloak.AttributeImporterIdentityProviderMapper("test_mapper", {
realm: "my-realm",
name: "my-mapper",
identityProviderAlias: "idp_alias",
attributeName: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
userAttribute: "lastName",
});import pulumi
import pulumi_keycloak as keycloak
test_mapper = keycloak.AttributeImporterIdentityProviderMapper("test_mapper",
realm="my-realm",
name="my-mapper",
identity_provider_alias="idp_alias",
attribute_name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
user_attribute="lastName")using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Keycloak = Pulumi.Keycloak;
return await Deployment.RunAsync(() =>
{
var testMapper = new Keycloak.AttributeImporterIdentityProviderMapper("test_mapper", new()
{
Realm = "my-realm",
Name = "my-mapper",
IdentityProviderAlias = "idp_alias",
AttributeName = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
UserAttribute = "lastName",
});
});package main
import (
"github.com/pulumi/pulumi-keycloak/sdk/v5/go/keycloak"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := keycloak.NewAttributeImporterIdentityProviderMapper(ctx, "test_mapper", &keycloak.AttributeImporterIdentityProviderMapperArgs{
Realm: pulumi.String("my-realm"),
Name: pulumi.String("my-mapper"),
IdentityProviderAlias: pulumi.String("idp_alias"),
AttributeName: pulumi.String("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"),
UserAttribute: pulumi.String("lastName"),
})
if err != nil {
return err
}
return nil
})
}package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.keycloak.AttributeImporterIdentityProviderMapper;
import com.pulumi.keycloak.AttributeImporterIdentityProviderMapperArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testMapper = new AttributeImporterIdentityProviderMapper("testMapper", AttributeImporterIdentityProviderMapperArgs.builder()
.realm("my-realm")
.name("my-mapper")
.identityProviderAlias("idp_alias")
.attributeName("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname")
.userAttribute("lastName")
.build());
}
}resources:
testMapper:
type: keycloak:AttributeImporterIdentityProviderMapper
name: test_mapper
properties:
realm: my-realm
name: my-mapper
identityProviderAlias: idp_alias
attributeName: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname
userAttribute: lastNameArgument Reference
The following arguments are supported:
realm- (Required) The name of the realm.name- (Required) The name of the mapper.identity_provider_alias- (Required) The alias of the associated identity provider.user_attribute- (Required) The user attribute name to store SAML attribute.attribute_name- (Optional) The Name of attribute to search for in assertion. You can leave this blank and specify a friendly name instead.attribute_friendly_name- (Optional) The friendly name of attribute to search for in assertion. You can leave this blank and specify an attribute name instead.claim_name- (Optional) The claim name.
Import
Identity provider mapper can be imported using the format {{realm_id}}/{{idp_alias}}/{{idp_mapper_id}}, where idp_alias is the identity provider alias, and idp_mapper_id is the unique ID that Keycloak assigns to the mapper upon creation. This value can be found in the URI when editing this mapper in the GUI, and is typically a GUID. Example:
$ terraform import keycloak_attribute_importer_identity_provider_mapper.test_mapper my-realm/my-mapper/f446db98-7133-4e30-b18a-3d28fde7ca1b