Keycloak

v4.11.0 published on Thursday, Aug 4, 2022 by Pulumi

getAuthenticationFlow

This data source can be used to fetch the ID of an authentication flow within Keycloak.

Example Usage

using Pulumi;
using Keycloak = Pulumi.Keycloak;

class MyStack : Stack
{
    public MyStack()
    {
        var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
        {
            RealmName = "my-realm",
            Enabled = true,
        });
        var browserAuthCookie = Keycloak.GetAuthenticationFlow.Invoke(new Keycloak.GetAuthenticationFlowInvokeArgs
        {
            RealmId = realm.Id,
            Alias = "browser",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-keycloak/sdk/v4/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("my-realm"),
			Enabled: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_ = keycloak.GetAuthenticationFlowOutput(ctx, GetAuthenticationFlowOutputArgs{
			RealmId: realm.ID(),
			Alias:   pulumi.String("browser"),
		}, nil)
		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.KeycloakFunctions;
import com.pulumi.keycloak.inputs.GetAuthenticationFlowArgs;
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());

        final var browserAuthCookie = KeycloakFunctions.getAuthenticationFlow(GetAuthenticationFlowArgs.builder()
            .realmId(realm.id())
            .alias("browser")
            .build());

    }
}
import pulumi
import pulumi_keycloak as keycloak

realm = keycloak.Realm("realm",
    realm="my-realm",
    enabled=True)
browser_auth_cookie = keycloak.get_authentication_flow_output(realm_id=realm.id,
    alias="browser")
import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";

const realm = new keycloak.Realm("realm", {
    realm: "my-realm",
    enabled: true,
});
const browserAuthCookie = keycloak.getAuthenticationFlowOutput({
    realmId: realm.id,
    alias: "browser",
});
resources:
  realm:
    type: keycloak:Realm
    properties:
      realm: my-realm
      enabled: true
variables:
  browserAuthCookie:
    Fn::Invoke:
      Function: keycloak:getAuthenticationFlow
      Arguments:
        realmId: ${realm.id}
        alias: browser

Using getAuthenticationFlow

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAuthenticationFlow(args: GetAuthenticationFlowArgs, opts?: InvokeOptions): Promise<GetAuthenticationFlowResult>
function getAuthenticationFlowOutput(args: GetAuthenticationFlowOutputArgs, opts?: InvokeOptions): Output<GetAuthenticationFlowResult>
def get_authentication_flow(alias: Optional[str] = None,
                            realm_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetAuthenticationFlowResult
def get_authentication_flow_output(alias: Optional[pulumi.Input[str]] = None,
                            realm_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetAuthenticationFlowResult]
func GetAuthenticationFlow(ctx *Context, args *GetAuthenticationFlowArgs, opts ...InvokeOption) (*GetAuthenticationFlowResult, error)
func GetAuthenticationFlowOutput(ctx *Context, args *GetAuthenticationFlowOutputArgs, opts ...InvokeOption) GetAuthenticationFlowResultOutput

> Note: This function is named GetAuthenticationFlow in the Go SDK.

public static class GetAuthenticationFlow 
{
    public static Task<GetAuthenticationFlowResult> InvokeAsync(GetAuthenticationFlowArgs args, InvokeOptions? opts = null)
    public static Output<GetAuthenticationFlowResult> Invoke(GetAuthenticationFlowInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAuthenticationFlowResult> getAuthenticationFlow(GetAuthenticationFlowArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: keycloak:index/getAuthenticationFlow:getAuthenticationFlow
  arguments:
    # arguments dictionary

The following arguments are supported:

Alias string

The alias of the flow.

RealmId string

The realm the authentication flow exists in.

Alias string

The alias of the flow.

RealmId string

The realm the authentication flow exists in.

alias String

The alias of the flow.

realmId String

The realm the authentication flow exists in.

alias string

The alias of the flow.

realmId string

The realm the authentication flow exists in.

alias str

The alias of the flow.

realm_id str

The realm the authentication flow exists in.

alias String

The alias of the flow.

realmId String

The realm the authentication flow exists in.

getAuthenticationFlow Result

The following output properties are available:

Alias string
Id string

The provider-assigned unique ID for this managed resource.

RealmId string
Alias string
Id string

The provider-assigned unique ID for this managed resource.

RealmId string
alias String
id String

The provider-assigned unique ID for this managed resource.

realmId String
alias string
id string

The provider-assigned unique ID for this managed resource.

realmId string
alias str
id str

The provider-assigned unique ID for this managed resource.

realm_id str
alias String
id String

The provider-assigned unique ID for this managed resource.

realmId String

Package Details

Repository
https://github.com/pulumi/pulumi-keycloak
License
Apache-2.0
Notes

This Pulumi package is based on the keycloak Terraform Provider.