CustomUserFederation

class CustomUserFederation : KotlinCustomResource

# keycloak.CustomUserFederation

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,
});
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)
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,
});
});
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),
})
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)
.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

Argument Reference

The following arguments are supported:

  • realm_id - (Required) The realm that this provider will provide user federation for.

  • name - (Required) Display name of the provider when displayed in the console.

  • provider_id - (Required) The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

  • enabled - (Optional) When false, this provider will not be used when performing queries for users. Defaults to true.

  • priority - (Optional) Priority of this provider when looking up users. Lower values are first. Defaults to 0.

  • cache_policy - (Optional) Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

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:

$ terraform import keycloak_custom_user_federation.custom_user_federation my-realm/af2a6ca3-e4d7-49c3-b08b-1b3c70b4b860

Properties

Link copied to clipboard
val cachePolicy: Output<String>?
Link copied to clipboard
val changedSyncPeriod: Output<Int>?

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, Any>>?
Link copied to clipboard
val enabled: Output<Boolean>?

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

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

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Display name of the provider when displayed in the console.

Link copied to clipboard
val parentId: Output<String>

The parent_id of the generated component. will use realm_id if not specified.

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

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

Link copied to clipboard
val providerId: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val realmId: Output<String>

The realm (name) this provider will provide user federation for.

Link copied to clipboard
val urn: Output<String>