SubflowArgs

data class SubflowArgs(val alias: Output<String>? = null, val authenticator: Output<String>? = null, val description: Output<String>? = null, val parentFlowAlias: Output<String>? = null, val priority: Output<Int>? = null, val providerId: Output<String>? = null, val realmId: Output<String>? = null, val requirement: Output<String>? = null) : ConvertibleToJava<SubflowArgs>

Allows for creating and managing an authentication subflow within Keycloak. Like authentication flows, authentication subflows are containers for authentication executions. As its name implies, an authentication subflow is contained in an authentication flow.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";
const realm = new keycloak.Realm("realm", {
realm: "my-realm",
enabled: true,
});
const flow = new keycloak.authentication.Flow("flow", {
realmId: realm.id,
alias: "my-flow-alias",
});
const subflow = new keycloak.authentication.Subflow("subflow", {
realmId: realm.id,
alias: "my-subflow-alias",
parentFlowAlias: flow.alias,
providerId: "basic-flow",
requirement: "ALTERNATIVE",
priority: 10,
});
import pulumi
import pulumi_keycloak as keycloak
realm = keycloak.Realm("realm",
realm="my-realm",
enabled=True)
flow = keycloak.authentication.Flow("flow",
realm_id=realm.id,
alias="my-flow-alias")
subflow = keycloak.authentication.Subflow("subflow",
realm_id=realm.id,
alias="my-subflow-alias",
parent_flow_alias=flow.alias,
provider_id="basic-flow",
requirement="ALTERNATIVE",
priority=10)
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 = "my-realm",
Enabled = true,
});
var flow = new Keycloak.Authentication.Flow("flow", new()
{
RealmId = realm.Id,
Alias = "my-flow-alias",
});
var subflow = new Keycloak.Authentication.Subflow("subflow", new()
{
RealmId = realm.Id,
Alias = "my-subflow-alias",
ParentFlowAlias = flow.Alias,
ProviderId = "basic-flow",
Requirement = "ALTERNATIVE",
Priority = 10,
});
});
package main
import (
"github.com/pulumi/pulumi-keycloak/sdk/v6/go/keycloak"
"github.com/pulumi/pulumi-keycloak/sdk/v6/go/keycloak/authentication"
"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("my-realm"),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
flow, err := authentication.NewFlow(ctx, "flow", &authentication.FlowArgs{
RealmId: realm.ID(),
Alias: pulumi.String("my-flow-alias"),
})
if err != nil {
return err
}
_, err = authentication.NewSubflow(ctx, "subflow", &authentication.SubflowArgs{
RealmId: realm.ID(),
Alias: pulumi.String("my-subflow-alias"),
ParentFlowAlias: flow.Alias,
ProviderId: pulumi.String("basic-flow"),
Requirement: pulumi.String("ALTERNATIVE"),
Priority: pulumi.Int(10),
})
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.authentication.Flow;
import com.pulumi.keycloak.authentication.FlowArgs;
import com.pulumi.keycloak.authentication.Subflow;
import com.pulumi.keycloak.authentication.SubflowArgs;
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("my-realm")
.enabled(true)
.build());
var flow = new Flow("flow", FlowArgs.builder()
.realmId(realm.id())
.alias("my-flow-alias")
.build());
var subflow = new Subflow("subflow", SubflowArgs.builder()
.realmId(realm.id())
.alias("my-subflow-alias")
.parentFlowAlias(flow.alias())
.providerId("basic-flow")
.requirement("ALTERNATIVE")
.priority(10)
.build());
}
}
resources:
realm:
type: keycloak:Realm
properties:
realm: my-realm
enabled: true
flow:
type: keycloak:authentication:Flow
properties:
realmId: ${realm.id}
alias: my-flow-alias
subflow:
type: keycloak:authentication:Subflow
properties:
realmId: ${realm.id}
alias: my-subflow-alias
parentFlowAlias: ${flow.alias}
providerId: basic-flow
requirement: ALTERNATIVE
priority: 10

Import

Authentication flows can be imported using the format {{realmId}}/{{parentFlowAlias}}/{{authenticationSubflowId}}. The authentication subflow ID is typically a GUID which is autogenerated when the subflow is created via Keycloak. Unfortunately, it is not trivial to retrieve the authentication subflow ID from the UI. The best way to do this is to visit the "Authentication" page in Keycloak, and use the network tab of your browser to view the response of the API call to /auth/admin/realms/${realm}/authentication/flows/{flow}/executions, which will be a list of executions, where the subflow will be. The subflow ID is contained in the flowID field (not, as one could guess, the id field). Example: bash

$ pulumi import keycloak:authentication/subflow:Subflow subflow my-realm/"Parent Flow"/3bad1172-bb5c-4a77-9615-c2606eb03081

Constructors

Link copied to clipboard
constructor(alias: Output<String>? = null, authenticator: Output<String>? = null, description: Output<String>? = null, parentFlowAlias: Output<String>? = null, priority: Output<Int>? = null, providerId: Output<String>? = null, realmId: Output<String>? = null, requirement: Output<String>? = null)

Properties

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

The alias for this authentication subflow.

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

The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.

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

A description for the authentication subflow.

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

The alias for the parent authentication flow.

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

The authenticator priority. Lower values will be executed prior higher values (Only supported by Keycloak >= 25).

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

The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.

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

The realm that the authentication subflow exists in.

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

The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.

Functions

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