keycloak.authentication.Execution
Explore with Pulumi AI
Allows for creating and managing an authentication execution within Keycloak.
An authentication execution is an action that the user or service may or may not take when authenticating through an authentication flow.
Due to limitations in the Keycloak API, the ordering of authentication executions within a flow must be specified using
depends_on
. Authentication executions that are created first will appear first within the 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",
});
// first execution
const executionOne = new keycloak.authentication.Execution("execution_one", {
realmId: realm.id,
parentFlowAlias: flow.alias,
authenticator: "auth-cookie",
requirement: "ALTERNATIVE",
});
// second execution
const executionTwo = new keycloak.authentication.Execution("execution_two", {
realmId: realm.id,
parentFlowAlias: flow.alias,
authenticator: "identity-provider-redirector",
requirement: "ALTERNATIVE",
}, {
dependsOn: [executionOne],
});
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")
# first execution
execution_one = keycloak.authentication.Execution("execution_one",
realm_id=realm.id,
parent_flow_alias=flow.alias,
authenticator="auth-cookie",
requirement="ALTERNATIVE")
# second execution
execution_two = keycloak.authentication.Execution("execution_two",
realm_id=realm.id,
parent_flow_alias=flow.alias,
authenticator="identity-provider-redirector",
requirement="ALTERNATIVE",
opts = pulumi.ResourceOptions(depends_on=[execution_one]))
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
}
// first execution
executionOne, err := authentication.NewExecution(ctx, "execution_one", &authentication.ExecutionArgs{
RealmId: realm.ID(),
ParentFlowAlias: flow.Alias,
Authenticator: pulumi.String("auth-cookie"),
Requirement: pulumi.String("ALTERNATIVE"),
})
if err != nil {
return err
}
// second execution
_, err = authentication.NewExecution(ctx, "execution_two", &authentication.ExecutionArgs{
RealmId: realm.ID(),
ParentFlowAlias: flow.Alias,
Authenticator: pulumi.String("identity-provider-redirector"),
Requirement: pulumi.String("ALTERNATIVE"),
}, pulumi.DependsOn([]pulumi.Resource{
executionOne,
}))
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",
});
// first execution
var executionOne = new Keycloak.Authentication.Execution("execution_one", new()
{
RealmId = realm.Id,
ParentFlowAlias = flow.Alias,
Authenticator = "auth-cookie",
Requirement = "ALTERNATIVE",
});
// second execution
var executionTwo = new Keycloak.Authentication.Execution("execution_two", new()
{
RealmId = realm.Id,
ParentFlowAlias = flow.Alias,
Authenticator = "identity-provider-redirector",
Requirement = "ALTERNATIVE",
}, new CustomResourceOptions
{
DependsOn =
{
executionOne,
},
});
});
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.Execution;
import com.pulumi.keycloak.authentication.ExecutionArgs;
import com.pulumi.resources.CustomResourceOptions;
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());
// first execution
var executionOne = new Execution("executionOne", ExecutionArgs.builder()
.realmId(realm.id())
.parentFlowAlias(flow.alias())
.authenticator("auth-cookie")
.requirement("ALTERNATIVE")
.build());
// second execution
var executionTwo = new Execution("executionTwo", ExecutionArgs.builder()
.realmId(realm.id())
.parentFlowAlias(flow.alias())
.authenticator("identity-provider-redirector")
.requirement("ALTERNATIVE")
.build(), CustomResourceOptions.builder()
.dependsOn(executionOne)
.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
# first execution
executionOne:
type: keycloak:authentication:Execution
name: execution_one
properties:
realmId: ${realm.id}
parentFlowAlias: ${flow.alias}
authenticator: auth-cookie
requirement: ALTERNATIVE
# second execution
executionTwo:
type: keycloak:authentication:Execution
name: execution_two
properties:
realmId: ${realm.id}
parentFlowAlias: ${flow.alias}
authenticator: identity-provider-redirector
requirement: ALTERNATIVE
options:
dependson:
- ${executionOne}
Create Execution Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Execution(name: string, args: ExecutionArgs, opts?: CustomResourceOptions);
@overload
def Execution(resource_name: str,
args: ExecutionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Execution(resource_name: str,
opts: Optional[ResourceOptions] = None,
authenticator: Optional[str] = None,
parent_flow_alias: Optional[str] = None,
realm_id: Optional[str] = None,
requirement: Optional[str] = None)
func NewExecution(ctx *Context, name string, args ExecutionArgs, opts ...ResourceOption) (*Execution, error)
public Execution(string name, ExecutionArgs args, CustomResourceOptions? opts = null)
public Execution(String name, ExecutionArgs args)
public Execution(String name, ExecutionArgs args, CustomResourceOptions options)
type: keycloak:authentication:Execution
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 ExecutionArgs
- 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 ExecutionArgs
- 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 ExecutionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExecutionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExecutionArgs
- 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 executionResource = new Keycloak.Authentication.Execution("executionResource", new()
{
Authenticator = "string",
ParentFlowAlias = "string",
RealmId = "string",
Requirement = "string",
});
example, err := authentication.NewExecution(ctx, "executionResource", &authentication.ExecutionArgs{
Authenticator: pulumi.String("string"),
ParentFlowAlias: pulumi.String("string"),
RealmId: pulumi.String("string"),
Requirement: pulumi.String("string"),
})
var executionResource = new Execution("executionResource", ExecutionArgs.builder()
.authenticator("string")
.parentFlowAlias("string")
.realmId("string")
.requirement("string")
.build());
execution_resource = keycloak.authentication.Execution("executionResource",
authenticator="string",
parent_flow_alias="string",
realm_id="string",
requirement="string")
const executionResource = new keycloak.authentication.Execution("executionResource", {
authenticator: "string",
parentFlowAlias: "string",
realmId: "string",
requirement: "string",
});
type: keycloak:authentication:Execution
properties:
authenticator: string
parentFlowAlias: string
realmId: string
requirement: string
Execution 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 Execution resource accepts the following input properties:
- Authenticator string
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- Parent
Flow stringAlias - The alias of the flow this execution is attached to.
- Realm
Id string - The realm the authentication execution exists in.
- Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- Authenticator string
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- Parent
Flow stringAlias - The alias of the flow this execution is attached to.
- Realm
Id string - The realm the authentication execution exists in.
- Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator String
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent
Flow StringAlias - The alias of the flow this execution is attached to.
- realm
Id String - The realm the authentication execution exists in.
- requirement String
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator string
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent
Flow stringAlias - The alias of the flow this execution is attached to.
- realm
Id string - The realm the authentication execution exists in.
- requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator str
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent_
flow_ stralias - The alias of the flow this execution is attached to.
- realm_
id str - The realm the authentication execution exists in.
- requirement str
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator String
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent
Flow StringAlias - The alias of the flow this execution is attached to.
- realm
Id String - The realm the authentication execution exists in.
- 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 Execution 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 Execution Resource
Get an existing Execution 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?: ExecutionState, opts?: CustomResourceOptions): Execution
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
authenticator: Optional[str] = None,
parent_flow_alias: Optional[str] = None,
realm_id: Optional[str] = None,
requirement: Optional[str] = None) -> Execution
func GetExecution(ctx *Context, name string, id IDInput, state *ExecutionState, opts ...ResourceOption) (*Execution, error)
public static Execution Get(string name, Input<string> id, ExecutionState? state, CustomResourceOptions? opts = null)
public static Execution get(String name, Output<String> id, ExecutionState 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.
- Authenticator string
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- Parent
Flow stringAlias - The alias of the flow this execution is attached to.
- Realm
Id string - The realm the authentication execution exists in.
- Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- Authenticator string
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- Parent
Flow stringAlias - The alias of the flow this execution is attached to.
- Realm
Id string - The realm the authentication execution exists in.
- Requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator String
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent
Flow StringAlias - The alias of the flow this execution is attached to.
- realm
Id String - The realm the authentication execution exists in.
- requirement String
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator string
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent
Flow stringAlias - The alias of the flow this execution is attached to.
- realm
Id string - The realm the authentication execution exists in.
- requirement string
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator str
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent_
flow_ stralias - The alias of the flow this execution is attached to.
- realm_
id str - The realm the authentication execution exists in.
- requirement str
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
- authenticator String
- The name of the authenticator. This can be found by experimenting with the GUI and looking at HTTP requests within the network tab of your browser's development tools.
- parent
Flow StringAlias - The alias of the flow this execution is attached to.
- realm
Id String - The realm the authentication execution exists in.
- requirement String
- The requirement setting, which can be one of
REQUIRED
,ALTERNATIVE
,OPTIONAL
,CONDITIONAL
, orDISABLED
. Defaults toDISABLED
.
Import
Authentication executions can be imported using the formats: {{realmId}}/{{parentFlowAlias}}/{{authenticationExecutionId}}
.
Example:
bash
$ pulumi import keycloak:authentication/execution:Execution execution_one my-realm/my-flow-alias/30559fcf-6fb8-45ea-8c46-2b86f46ebc17
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.