ClientScopeArgs

data class ClientScopeArgs(val consentScreenText: Output<String>? = null, val description: Output<String>? = null, val guiOrder: Output<Int>? = null, val name: Output<String>? = null, val realmId: Output<String>? = null) : ConvertibleToJava<ClientScopeArgs>

Allows for creating and managing Keycloak client scopes that can be attached to clients that use the SAML protocol. Client Scopes can be used to share common protocol and role mappings between multiple clients within a realm.

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 samlClientScope = new keycloak.saml.ClientScope("saml_client_scope", {
realmId: realm.id,
name: "groups",
description: "This scope will map a user's group memberships to SAML assertion",
guiOrder: 1,
});
import pulumi
import pulumi_keycloak as keycloak
realm = keycloak.Realm("realm",
realm="my-realm",
enabled=True)
saml_client_scope = keycloak.saml.ClientScope("saml_client_scope",
realm_id=realm.id,
name="groups",
description="This scope will map a user's group memberships to SAML assertion",
gui_order=1)
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 samlClientScope = new Keycloak.Saml.ClientScope("saml_client_scope", new()
{
RealmId = realm.Id,
Name = "groups",
Description = "This scope will map a user's group memberships to SAML assertion",
GuiOrder = 1,
});
});
package main
import (
"github.com/pulumi/pulumi-keycloak/sdk/v6/go/keycloak"
"github.com/pulumi/pulumi-keycloak/sdk/v6/go/keycloak/saml"
"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
}
_, err = saml.NewClientScope(ctx, "saml_client_scope", &saml.ClientScopeArgs{
RealmId: realm.ID(),
Name: pulumi.String("groups"),
Description: pulumi.String("This scope will map a user's group memberships to SAML assertion"),
GuiOrder: pulumi.Int(1),
})
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.saml.ClientScope;
import com.pulumi.keycloak.saml.ClientScopeArgs;
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 samlClientScope = new ClientScope("samlClientScope", ClientScopeArgs.builder()
.realmId(realm.id())
.name("groups")
.description("This scope will map a user's group memberships to SAML assertion")
.guiOrder(1)
.build());
}
}
resources:
realm:
type: keycloak:Realm
properties:
realm: my-realm
enabled: true
samlClientScope:
type: keycloak:saml:ClientScope
name: saml_client_scope
properties:
realmId: ${realm.id}
name: groups
description: This scope will map a user's group memberships to SAML assertion
guiOrder: 1

Import

Client scopes can be imported using the format {{realm_id}}/{{client_scope_id}}, where client_scope_id is the unique ID that Keycloak assigns to the client scope upon creation. This value can be found in the URI when editing this client scope in the GUI, and is typically a GUID. Example: bash

$ pulumi import keycloak:saml/clientScope:ClientScope saml_client_scope my-realm/e8a5d115-6985-4de3-a0f5-732e1be4525e

Constructors

Link copied to clipboard
constructor(consentScreenText: Output<String>? = null, description: Output<String>? = null, guiOrder: Output<Int>? = null, name: Output<String>? = null, realmId: Output<String>? = null)

Properties

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

When set, a consent screen will be displayed to users authenticating to clients with this scope attached. The consent screen will display the string value of this attribute.

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

The description of this client scope in the GUI.

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

Specify order of the client scope in GUI (such as in Consent page) as integer.

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

The display name of this client scope in the GUI.

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

The realm this client scope belongs to.

Functions

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