1. Packages
  2. Keycloak
  3. API Docs
  4. authentication
  5. Subflow
Keycloak v5.3.1 published on Monday, Mar 11, 2024 by Pulumi

keycloak.authentication.Subflow

Explore with Pulumi AI

keycloak logo
Keycloak v5.3.1 published on Monday, Mar 11, 2024 by Pulumi

    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",
    });
    
    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")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-keycloak/sdk/v5/go/keycloak"
    	"github.com/pulumi/pulumi-keycloak/sdk/v5/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"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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",
        });
    
    });
    
    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")
                .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
    

    Create Subflow Resource

    new Subflow(name: string, args: SubflowArgs, opts?: CustomResourceOptions);
    @overload
    def Subflow(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                alias: Optional[str] = None,
                authenticator: Optional[str] = None,
                description: Optional[str] = None,
                parent_flow_alias: Optional[str] = None,
                provider_id: Optional[str] = None,
                realm_id: Optional[str] = None,
                requirement: Optional[str] = None)
    @overload
    def Subflow(resource_name: str,
                args: SubflowArgs,
                opts: Optional[ResourceOptions] = None)
    func NewSubflow(ctx *Context, name string, args SubflowArgs, opts ...ResourceOption) (*Subflow, error)
    public Subflow(string name, SubflowArgs args, CustomResourceOptions? opts = null)
    public Subflow(String name, SubflowArgs args)
    public Subflow(String name, SubflowArgs args, CustomResourceOptions options)
    
    type: keycloak:authentication:Subflow
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args SubflowArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SubflowArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SubflowArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SubflowArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SubflowArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Subflow Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Subflow resource accepts the following input properties:

    Alias string
    The alias for this authentication subflow.
    ParentFlowAlias string
    The alias for the parent authentication flow.
    RealmId string
    The realm that the authentication subflow exists in.
    Authenticator string
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    Description string
    A description for the authentication subflow.
    ProviderId string
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    Requirement string
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    Alias string
    The alias for this authentication subflow.
    ParentFlowAlias string
    The alias for the parent authentication flow.
    RealmId string
    The realm that the authentication subflow exists in.
    Authenticator string
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    Description string
    A description for the authentication subflow.
    ProviderId string
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    Requirement string
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias String
    The alias for this authentication subflow.
    parentFlowAlias String
    The alias for the parent authentication flow.
    realmId String
    The realm that the authentication subflow exists in.
    authenticator String
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description String
    A description for the authentication subflow.
    providerId String
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    requirement String
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias string
    The alias for this authentication subflow.
    parentFlowAlias string
    The alias for the parent authentication flow.
    realmId string
    The realm that the authentication subflow exists in.
    authenticator string
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description string
    A description for the authentication subflow.
    providerId string
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    requirement string
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias str
    The alias for this authentication subflow.
    parent_flow_alias str
    The alias for the parent authentication flow.
    realm_id str
    The realm that the authentication subflow exists in.
    authenticator str
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description str
    A description for the authentication subflow.
    provider_id str
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    requirement str
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias String
    The alias for this authentication subflow.
    parentFlowAlias String
    The alias for the parent authentication flow.
    realmId String
    The realm that the authentication subflow exists in.
    authenticator String
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description String
    A description for the authentication subflow.
    providerId String
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    requirement String
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Subflow resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Subflow Resource

    Get an existing Subflow resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SubflowState, opts?: CustomResourceOptions): Subflow
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alias: Optional[str] = None,
            authenticator: Optional[str] = None,
            description: Optional[str] = None,
            parent_flow_alias: Optional[str] = None,
            provider_id: Optional[str] = None,
            realm_id: Optional[str] = None,
            requirement: Optional[str] = None) -> Subflow
    func GetSubflow(ctx *Context, name string, id IDInput, state *SubflowState, opts ...ResourceOption) (*Subflow, error)
    public static Subflow Get(string name, Input<string> id, SubflowState? state, CustomResourceOptions? opts = null)
    public static Subflow get(String name, Output<String> id, SubflowState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Alias string
    The alias for this authentication subflow.
    Authenticator string
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    Description string
    A description for the authentication subflow.
    ParentFlowAlias string
    The alias for the parent authentication flow.
    ProviderId string
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    RealmId string
    The realm that the authentication subflow exists in.
    Requirement string
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    Alias string
    The alias for this authentication subflow.
    Authenticator string
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    Description string
    A description for the authentication subflow.
    ParentFlowAlias string
    The alias for the parent authentication flow.
    ProviderId string
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    RealmId string
    The realm that the authentication subflow exists in.
    Requirement string
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias String
    The alias for this authentication subflow.
    authenticator String
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description String
    A description for the authentication subflow.
    parentFlowAlias String
    The alias for the parent authentication flow.
    providerId String
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    realmId String
    The realm that the authentication subflow exists in.
    requirement String
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias string
    The alias for this authentication subflow.
    authenticator string
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description string
    A description for the authentication subflow.
    parentFlowAlias string
    The alias for the parent authentication flow.
    providerId string
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    realmId string
    The realm that the authentication subflow exists in.
    requirement string
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias str
    The alias for this authentication subflow.
    authenticator str
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description str
    A description for the authentication subflow.
    parent_flow_alias str
    The alias for the parent authentication flow.
    provider_id str
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    realm_id str
    The realm that the authentication subflow exists in.
    requirement str
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.
    alias String
    The alias for this authentication subflow.
    authenticator String
    The name of the authenticator. Might be needed to be set with certain custom subflows with specific authenticators. In general this will remain empty.
    description String
    A description for the authentication subflow.
    parentFlowAlias String
    The alias for the parent authentication flow.
    providerId String
    The type of authentication subflow to create. Valid choices include basic-flow, form-flow and client-flow. Defaults to basic-flow.
    realmId String
    The realm that the authentication subflow exists in.
    requirement String
    The requirement setting, which can be one of REQUIRED, ALTERNATIVE, OPTIONAL, CONDITIONAL, or DISABLED. Defaults to DISABLED.

    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
    

    Package Details

    Repository
    Keycloak pulumi/pulumi-keycloak
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the keycloak Terraform Provider.
    keycloak logo
    Keycloak v5.3.1 published on Monday, Mar 11, 2024 by Pulumi