CustomUserFederationArgs

data class CustomUserFederationArgs(val cachePolicy: Output<String>? = null, val changedSyncPeriod: Output<Int>? = null, val config: Output<Map<String, String>>? = null, val enabled: Output<Boolean>? = null, val fullSyncPeriod: Output<Int>? = null, val name: Output<String>? = null, val parentId: Output<String>? = null, val priority: Output<Int>? = null, val providerId: Output<String>? = null, val realmId: Output<String>? = null) : ConvertibleToJava<CustomUserFederationArgs>

Allows for creating and managing custom user federation providers within Keycloak. A custom user federation provider is an implementation of Keycloak's User Storage SPI. An example of this implementation can be found here.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";
const realm = new keycloak.Realm("realm", {
realm: "test",
enabled: true,
});
const customUserFederation = new keycloak.CustomUserFederation("custom_user_federation", {
name: "custom",
realmId: realm.id,
providerId: "custom",
enabled: true,
config: {
dummyString: "foobar",
dummyBool: "true",
multivalue: "value1##value2",
},
});
import pulumi
import pulumi_keycloak as keycloak
realm = keycloak.Realm("realm",
realm="test",
enabled=True)
custom_user_federation = keycloak.CustomUserFederation("custom_user_federation",
name="custom",
realm_id=realm.id,
provider_id="custom",
enabled=True,
config={
"dummyString": "foobar",
"dummyBool": "true",
"multivalue": "value1##value2",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Keycloak = Pulumi.Keycloak;
return await Deployment.RunAsync(() =>
{
var realm = new Keycloak.Realm("realm", new()
{
RealmName = "test",
Enabled = true,
});
var customUserFederation = new Keycloak.CustomUserFederation("custom_user_federation", new()
{
Name = "custom",
RealmId = realm.Id,
ProviderId = "custom",
Enabled = true,
Config =
{
{ "dummyString", "foobar" },
{ "dummyBool", "true" },
{ "multivalue", "value1##value2" },
},
});
});
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 {
realm, err := keycloak.NewRealm(ctx, "realm", &keycloak.RealmArgs{
Realm: pulumi.String("test"),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = keycloak.NewCustomUserFederation(ctx, "custom_user_federation", &keycloak.CustomUserFederationArgs{
Name: pulumi.String("custom"),
RealmId: realm.ID(),
ProviderId: pulumi.String("custom"),
Enabled: pulumi.Bool(true),
Config: pulumi.StringMap{
"dummyString": pulumi.String("foobar"),
"dummyBool": pulumi.String("true"),
"multivalue": pulumi.String("value1##value2"),
},
})
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.Realm;
import com.pulumi.keycloak.RealmArgs;
import com.pulumi.keycloak.CustomUserFederation;
import com.pulumi.keycloak.CustomUserFederationArgs;
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 realm = new Realm("realm", RealmArgs.builder()
.realm("test")
.enabled(true)
.build());
var customUserFederation = new CustomUserFederation("customUserFederation", CustomUserFederationArgs.builder()
.name("custom")
.realmId(realm.id())
.providerId("custom")
.enabled(true)
.config(Map.ofEntries(
Map.entry("dummyString", "foobar"),
Map.entry("dummyBool", true),
Map.entry("multivalue", "value1##value2")
))
.build());
}
}
resources:
realm:
type: keycloak:Realm
properties:
realm: test
enabled: true
customUserFederation:
type: keycloak:CustomUserFederation
name: custom_user_federation
properties:
name: custom
realmId: ${realm.id}
providerId: custom
enabled: true
config:
dummyString: foobar
dummyBool: true
multivalue: value1##value2

Import

Custom user federation providers can be imported using the format {{realm_id}}/{{custom_user_federation_id}}. The ID of the custom user federation provider can be found within the Keycloak GUI and is typically a GUID: bash

$ pulumi import keycloak:index/customUserFederation:CustomUserFederation custom_user_federation my-realm/af2a6ca3-e4d7-49c3-b08b-1b3c70b4b860

Constructors

Link copied to clipboard
constructor(cachePolicy: Output<String>? = null, changedSyncPeriod: Output<Int>? = null, config: Output<Map<String, String>>? = null, enabled: Output<Boolean>? = null, fullSyncPeriod: Output<Int>? = null, name: Output<String>? = null, parentId: Output<String>? = null, priority: Output<Int>? = null, providerId: Output<String>? = null, realmId: Output<String>? = null)

Properties

Link copied to clipboard
val cachePolicy: Output<String>? = null

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

Link copied to clipboard
val changedSyncPeriod: Output<Int>? = null

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

Link copied to clipboard
val config: Output<Map<String, String>>? = null

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

Link copied to clipboard
val enabled: Output<Boolean>? = null

When false, this provider will not be used when performing queries for users. Defaults to true.

Link copied to clipboard
val fullSyncPeriod: Output<Int>? = null

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

Link copied to clipboard
val name: Output<String>? = null

Display name of the provider when displayed in the console.

Link copied to clipboard
val parentId: Output<String>? = null

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

Link copied to clipboard
val priority: Output<Int>? = null

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

Link copied to clipboard
val providerId: Output<String>? = null

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

Link copied to clipboard
val realmId: Output<String>? = null

The realm that this provider will provide user federation for.

Functions

Link copied to clipboard
open override fun toJava(): CustomUserFederationArgs