keycloak.authentication.Subflow
Explore with Pulumi AI
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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Subflow(name: string, args: SubflowArgs, opts?: CustomResourceOptions);
@overload
def Subflow(resource_name: str,
args: SubflowArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Subflow(resource_name: str,
opts: Optional[ResourceOptions] = None,
alias: Optional[str] = None,
parent_flow_alias: Optional[str] = None,
realm_id: Optional[str] = None,
authenticator: Optional[str] = None,
description: Optional[str] = None,
provider_id: Optional[str] = None,
requirement: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var subflowResource = new Keycloak.Authentication.Subflow("subflowResource", new()
{
Alias = "string",
ParentFlowAlias = "string",
RealmId = "string",
Authenticator = "string",
Description = "string",
ProviderId = "string",
Requirement = "string",
});
example, err := authentication.NewSubflow(ctx, "subflowResource", &authentication.SubflowArgs{
Alias: pulumi.String("string"),
ParentFlowAlias: pulumi.String("string"),
RealmId: pulumi.String("string"),
Authenticator: pulumi.String("string"),
Description: pulumi.String("string"),
ProviderId: pulumi.String("string"),
Requirement: pulumi.String("string"),
})
var subflowResource = new Subflow("subflowResource", SubflowArgs.builder()
.alias("string")
.parentFlowAlias("string")
.realmId("string")
.authenticator("string")
.description("string")
.providerId("string")
.requirement("string")
.build());
subflow_resource = keycloak.authentication.Subflow("subflowResource",
alias="string",
parent_flow_alias="string",
realm_id="string",
authenticator="string",
description="string",
provider_id="string",
requirement="string")
const subflowResource = new keycloak.authentication.Subflow("subflowResource", {
alias: "string",
parentFlowAlias: "string",
realmId: "string",
authenticator: "string",
description: "string",
providerId: "string",
requirement: "string",
});
type: keycloak:authentication:Subflow
properties:
alias: string
authenticator: string
description: string
parentFlowAlias: string
providerId: string
realmId: string
requirement: string
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.
- Parent
Flow stringAlias - The alias for the parent authentication flow.
- Realm
Id 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.
- Provider
Id string - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- Alias string
- The alias for this authentication subflow.
- Parent
Flow stringAlias - The alias for the parent authentication flow.
- Realm
Id 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.
- Provider
Id string - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- alias String
- The alias for this authentication subflow.
- parent
Flow StringAlias - The alias for the parent authentication flow.
- realm
Id 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.
- provider
Id String - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - requirement String
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- alias string
- The alias for this authentication subflow.
- parent
Flow stringAlias - The alias for the parent authentication flow.
- realm
Id 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.
- provider
Id string - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- alias str
- The alias for this authentication subflow.
- parent_
flow_ stralias - 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
andclient-flow
. Defaults tobasic-flow
. - requirement str
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- alias String
- The alias for this authentication subflow.
- parent
Flow StringAlias - The alias for the parent authentication flow.
- realm
Id 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.
- provider
Id String - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - requirement String
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
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.
- 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.
- Parent
Flow stringAlias - The alias for the parent authentication flow.
- Provider
Id string - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - Realm
Id string - The realm that the authentication subflow exists in.
- Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- 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.
- Parent
Flow stringAlias - The alias for the parent authentication flow.
- Provider
Id string - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - Realm
Id string - The realm that the authentication subflow exists in.
- Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- 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.
- parent
Flow StringAlias - The alias for the parent authentication flow.
- provider
Id String - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - realm
Id String - The realm that the authentication subflow exists in.
- requirement String
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- 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.
- parent
Flow stringAlias - The alias for the parent authentication flow.
- provider
Id string - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - realm
Id string - The realm that the authentication subflow exists in.
- requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- 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_ stralias - The alias for the parent authentication flow.
- provider_
id str - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-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
, orDISABLED
. Defaults toDISABLED
.
- 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.
- parent
Flow StringAlias - The alias for the parent authentication flow.
- provider
Id String - The type of authentication subflow to create. Valid choices include
basic-flow
,form-flow
andclient-flow
. Defaults tobasic-flow
. - realm
Id String - The realm that the authentication subflow exists in.
- requirement String
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Keycloak pulumi/pulumi-keycloak
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
keycloak
Terraform Provider.