Class User
# keycloak..User
Allows for creating and managing Users within Keycloak.
This resource was created primarily to enable the acceptance tests for the keycloak..Group resource.
Creating users within Keycloak is not recommended. Instead, users should be federated from external sources
by configuring user federation providers or identity providers.
Example Usage
using Pulumi;
using Keycloak = Pulumi.Keycloak;
class MyStack : Stack
{
public MyStack()
{
var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
{
Enabled = true,
Realm = "my-realm",
});
var user = new Keycloak.User("user", new Keycloak.UserArgs
{
Email = "bob@domain.com",
Enabled = true,
FirstName = "Bob",
LastName = "Bobson",
RealmId = realm.Id,
Username = "bob",
});
var userWithInitialPassword = new Keycloak.User("userWithInitialPassword", new Keycloak.UserArgs
{
Email = "alice@domain.com",
Enabled = true,
FirstName = "Alice",
InitialPassword = new Keycloak.Inputs.UserInitialPasswordArgs
{
Temporary = true,
Value = "some password",
},
LastName = "Aliceberg",
RealmId = realm.Id,
Username = "alice",
});
}
}
Argument Reference
The following arguments are supported:
realm_id - (Required) The realm this user belongs to.
username - (Required) The unique username of this user.
initial_password (Optional) When given, the user's initial password will be set.
This attribute is only respected during initial user creation.
value (Required) The initial password.
temporary (Optional) If set to true, the initial password is set up for renewal on first use. Default to false.
enabled - (Optional) When false, this user cannot log in. Defaults to true.
email - (Optional) The user's email.
first_name - (Optional) The user's first name.
last_name - (Optional) The user's last name.
Inheritance
System.Object
User
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Pulumi.Keycloak.dll
Syntax
public class User : CustomResource
Constructors
View Source
User(String, UserArgs, CustomResourceOptions)
Create a User resource with the given unique name, arguments, and options.
Declaration
public User(string name, UserArgs args, CustomResourceOptions options = null)
Parameters
| Type |
Name |
Description |
| System.String |
name |
The unique name of the resource
|
| UserArgs |
args |
The arguments used to populate this resource's properties
|
| CustomResourceOptions |
options |
A bag of options that control this resource's behavior
|
Properties
View Source
Attributes
Declaration
public Output<ImmutableDictionary<string, object>> Attributes { get; }
Property Value
| Type |
Description |
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
|
View Source
Email
Declaration
public Output<string> Email { get; }
Property Value
| Type |
Description |
| Output<System.String> |
|
View Source
EmailVerified
Declaration
public Output<bool?> EmailVerified { get; }
Property Value
| Type |
Description |
| Output<System.Nullable<System.Boolean>> |
|
View Source
Enabled
Declaration
public Output<bool?> Enabled { get; }
Property Value
| Type |
Description |
| Output<System.Nullable<System.Boolean>> |
|
View Source
FederatedIdentities
Declaration
public Output<ImmutableArray<UserFederatedIdentity>> FederatedIdentities { get; }
Property Value
View Source
FirstName
Declaration
public Output<string> FirstName { get; }
Property Value
| Type |
Description |
| Output<System.String> |
|
View Source
InitialPassword
Declaration
public Output<UserInitialPassword> InitialPassword { get; }
Property Value
View Source
LastName
Declaration
public Output<string> LastName { get; }
Property Value
| Type |
Description |
| Output<System.String> |
|
View Source
RealmId
Declaration
public Output<string> RealmId { get; }
Property Value
| Type |
Description |
| Output<System.String> |
|
View Source
Username
Declaration
public Output<string> Username { get; }
Property Value
| Type |
Description |
| Output<System.String> |
|
Methods
View Source
Get an existing User resource's state with the given name, ID, and optional extra
properties used to qualify the lookup.
Declaration
public static User Get(string name, Input<string> id, UserState state = null, CustomResourceOptions options = null)
Parameters
| Type |
Name |
Description |
| System.String |
name |
The unique name of the resulting resource.
|
| Input<System.String> |
id |
The unique provider ID of the resource to lookup.
|
| UserState |
state |
Any extra arguments used during the lookup.
|
| CustomResourceOptions |
options |
A bag of options that control this resource's behavior
|
Returns