Custom User Federation Args
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/v6/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
Properties
Can be one of DEFAULT
, EVICT_DAILY
, EVICT_WEEKLY
, MAX_LIFESPAN
, or NO_CACHE
. Defaults to DEFAULT
.
How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.
How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.
The unique ID of the custom provider, specified in the getId
implementation for the UserStorageProviderFactory
interface.