Auth0
User
With this resource, you can manage user identities, including resetting passwords, and creating, provisioning, blocking, and deleting users.
Example Usage
using Pulumi;
using Auth0 = Pulumi.Auth0;
class MyStack : Stack
{
public MyStack()
{
var admin = new Auth0.Role("admin", new Auth0.RoleArgs
{
Description = "Administrator",
});
var user = new Auth0.User("user", new Auth0.UserArgs
{
ConnectionName = "Username-Password-Authentication",
UserId = "12345",
Username = "unique_username",
GivenName = "Firstname",
FamilyName = "Lastname",
Nickname = "some.nickname",
Email = "test@test.com",
EmailVerified = true,
Password = "passpass$12$12",
Roles =
{
admin.Id,
},
});
}
}
package main
import (
"fmt"
"github.com/pulumi/pulumi-auth0/sdk/v2/go/auth0"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
admin, err := auth0.NewRole(ctx, "admin", &auth0.RoleArgs{
Description: pulumi.String("Administrator"),
})
if err != nil {
return err
}
_, err = auth0.NewUser(ctx, "user", &auth0.UserArgs{
ConnectionName: pulumi.String("Username-Password-Authentication"),
UserId: pulumi.String("12345"),
Username: pulumi.String("unique_username"),
GivenName: pulumi.String("Firstname"),
FamilyName: pulumi.String("Lastname"),
Nickname: pulumi.String("some.nickname"),
Email: pulumi.String("test@test.com"),
EmailVerified: pulumi.Bool(true),
Password: pulumi.String(fmt.Sprintf("%v%v%v%v%v", "passpass", "$", "12", "$", "12")),
Roles: pulumi.StringArray{
admin.ID(),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var admin = new Role("admin", RoleArgs.builder()
.description("Administrator")
.build());
var user = new User("user", UserArgs.builder()
.connectionName("Username-Password-Authentication")
.userId("12345")
.username("unique_username")
.givenName("Firstname")
.familyName("Lastname")
.nickname("some.nickname")
.email("test@test.com")
.emailVerified(true)
.password("passpass$12$12")
.roles(admin.id())
.build());
}
}
import pulumi
import pulumi_auth0 as auth0
admin = auth0.Role("admin", description="Administrator")
user = auth0.User("user",
connection_name="Username-Password-Authentication",
user_id="12345",
username="unique_username",
given_name="Firstname",
family_name="Lastname",
nickname="some.nickname",
email="test@test.com",
email_verified=True,
password="passpass$12$12",
roles=[admin.id])
import * as pulumi from "@pulumi/pulumi";
import * as auth0 from "@pulumi/auth0";
const admin = new auth0.Role("admin", {description: "Administrator"});
const user = new auth0.User("user", {
connectionName: "Username-Password-Authentication",
userId: "12345",
username: "unique_username",
givenName: "Firstname",
familyName: "Lastname",
nickname: "some.nickname",
email: "test@test.com",
emailVerified: true,
password: `passpass$12$12`,
roles: [admin.id],
});
resources:
user:
type: auth0:User
properties:
connectionName: Username-Password-Authentication
userId: 12345
username: unique_username
givenName: Firstname
familyName: Lastname
nickname: some.nickname
email: test@test.com
emailVerified: true
password: passpass$12$12
roles:
- ${admin.id}
admin:
type: auth0:Role
properties:
description: Administrator
Create a User Resource
new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
opts: Optional[ResourceOptions] = None,
app_metadata: Optional[str] = None,
blocked: Optional[bool] = None,
connection_name: Optional[str] = None,
email: Optional[str] = None,
email_verified: Optional[bool] = None,
family_name: Optional[str] = None,
given_name: Optional[str] = None,
name: Optional[str] = None,
nickname: Optional[str] = None,
password: Optional[str] = None,
phone_number: Optional[str] = None,
phone_verified: Optional[bool] = None,
picture: Optional[str] = None,
roles: Optional[Sequence[str]] = None,
user_id: Optional[str] = None,
user_metadata: Optional[str] = None,
username: Optional[str] = None,
verify_email: Optional[bool] = None)
@overload
def User(resource_name: str,
args: UserArgs,
opts: Optional[ResourceOptions] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
type: auth0:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- 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 UserArgs
- 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 UserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
User 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 User resource accepts the following input properties:
- Connection
Name string String. Name of the connection from which the user information was sourced.
- App
Metadata string String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- Blocked bool
- Email string
String. Email address of the user.
- Email
Verified bool Boolean. Indicates whether the email address has been verified.
- Family
Name string - Given
Name string - Name string
- Nickname string
String. Preferred nickname or alias of the user.
- Password string
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- Phone
Number string String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- Phone
Verified bool Boolean. Indicates whether the phone number has been verified.
- Picture string
- Roles List<string>
Set(String). Set of IDs of roles assigned to the user.
- User
Id string String. ID of the user.
- User
Metadata string String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- Username string
String. Username of the user. Only valid if the connection requires a username.
- Verify
Email bool Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- Connection
Name string String. Name of the connection from which the user information was sourced.
- App
Metadata string String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- Blocked bool
- Email string
String. Email address of the user.
- Email
Verified bool Boolean. Indicates whether the email address has been verified.
- Family
Name string - Given
Name string - Name string
- Nickname string
String. Preferred nickname or alias of the user.
- Password string
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- Phone
Number string String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- Phone
Verified bool Boolean. Indicates whether the phone number has been verified.
- Picture string
- Roles []string
Set(String). Set of IDs of roles assigned to the user.
- User
Id string String. ID of the user.
- User
Metadata string String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- Username string
String. Username of the user. Only valid if the connection requires a username.
- Verify
Email bool Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- connection
Name String String. Name of the connection from which the user information was sourced.
- app
Metadata String String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked Boolean
- email String
String. Email address of the user.
- email
Verified Boolean Boolean. Indicates whether the email address has been verified.
- family
Name String - given
Name String - name String
- nickname String
String. Preferred nickname or alias of the user.
- password String
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone
Number String String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone
Verified Boolean Boolean. Indicates whether the phone number has been verified.
- picture String
- roles List<String>
Set(String). Set of IDs of roles assigned to the user.
- user
Id String String. ID of the user.
- user
Metadata String String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username String
String. Username of the user. Only valid if the connection requires a username.
- verify
Email Boolean Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- connection
Name string String. Name of the connection from which the user information was sourced.
- app
Metadata string String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked boolean
- email string
String. Email address of the user.
- email
Verified boolean Boolean. Indicates whether the email address has been verified.
- family
Name string - given
Name string - name string
- nickname string
String. Preferred nickname or alias of the user.
- password string
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone
Number string String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone
Verified boolean Boolean. Indicates whether the phone number has been verified.
- picture string
- roles string[]
Set(String). Set of IDs of roles assigned to the user.
- user
Id string String. ID of the user.
- user
Metadata string String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username string
String. Username of the user. Only valid if the connection requires a username.
- verify
Email boolean Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- connection_
name str String. Name of the connection from which the user information was sourced.
- app_
metadata str String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked bool
- email str
String. Email address of the user.
- email_
verified bool Boolean. Indicates whether the email address has been verified.
- family_
name str - given_
name str - name str
- nickname str
String. Preferred nickname or alias of the user.
- password str
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone_
number str String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone_
verified bool Boolean. Indicates whether the phone number has been verified.
- picture str
- roles Sequence[str]
Set(String). Set of IDs of roles assigned to the user.
- user_
id str String. ID of the user.
- user_
metadata str String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username str
String. Username of the user. Only valid if the connection requires a username.
- verify_
email bool Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- connection
Name String String. Name of the connection from which the user information was sourced.
- app
Metadata String String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked Boolean
- email String
String. Email address of the user.
- email
Verified Boolean Boolean. Indicates whether the email address has been verified.
- family
Name String - given
Name String - name String
- nickname String
String. Preferred nickname or alias of the user.
- password String
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone
Number String String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone
Verified Boolean Boolean. Indicates whether the phone number has been verified.
- picture String
- roles List<String>
Set(String). Set of IDs of roles assigned to the user.
- user
Id String String. ID of the user.
- user
Metadata String String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username String
String. Username of the user. Only valid if the connection requires a username.
- verify
Email Boolean Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
Outputs
All input properties are implicitly available as output properties. Additionally, the User 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 an Existing User Resource
Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
app_metadata: Optional[str] = None,
blocked: Optional[bool] = None,
connection_name: Optional[str] = None,
email: Optional[str] = None,
email_verified: Optional[bool] = None,
family_name: Optional[str] = None,
given_name: Optional[str] = None,
name: Optional[str] = None,
nickname: Optional[str] = None,
password: Optional[str] = None,
phone_number: Optional[str] = None,
phone_verified: Optional[bool] = None,
picture: Optional[str] = None,
roles: Optional[Sequence[str]] = None,
user_id: Optional[str] = None,
user_metadata: Optional[str] = None,
username: Optional[str] = None,
verify_email: Optional[bool] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState 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.
- App
Metadata string String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- Blocked bool
- Connection
Name string String. Name of the connection from which the user information was sourced.
- Email string
String. Email address of the user.
- Email
Verified bool Boolean. Indicates whether the email address has been verified.
- Family
Name string - Given
Name string - Name string
- Nickname string
String. Preferred nickname or alias of the user.
- Password string
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- Phone
Number string String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- Phone
Verified bool Boolean. Indicates whether the phone number has been verified.
- Picture string
- Roles List<string>
Set(String). Set of IDs of roles assigned to the user.
- User
Id string String. ID of the user.
- User
Metadata string String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- Username string
String. Username of the user. Only valid if the connection requires a username.
- Verify
Email bool Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- App
Metadata string String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- Blocked bool
- Connection
Name string String. Name of the connection from which the user information was sourced.
- Email string
String. Email address of the user.
- Email
Verified bool Boolean. Indicates whether the email address has been verified.
- Family
Name string - Given
Name string - Name string
- Nickname string
String. Preferred nickname or alias of the user.
- Password string
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- Phone
Number string String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- Phone
Verified bool Boolean. Indicates whether the phone number has been verified.
- Picture string
- Roles []string
Set(String). Set of IDs of roles assigned to the user.
- User
Id string String. ID of the user.
- User
Metadata string String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- Username string
String. Username of the user. Only valid if the connection requires a username.
- Verify
Email bool Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- app
Metadata String String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked Boolean
- connection
Name String String. Name of the connection from which the user information was sourced.
- email String
String. Email address of the user.
- email
Verified Boolean Boolean. Indicates whether the email address has been verified.
- family
Name String - given
Name String - name String
- nickname String
String. Preferred nickname or alias of the user.
- password String
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone
Number String String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone
Verified Boolean Boolean. Indicates whether the phone number has been verified.
- picture String
- roles List<String>
Set(String). Set of IDs of roles assigned to the user.
- user
Id String String. ID of the user.
- user
Metadata String String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username String
String. Username of the user. Only valid if the connection requires a username.
- verify
Email Boolean Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- app
Metadata string String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked boolean
- connection
Name string String. Name of the connection from which the user information was sourced.
- email string
String. Email address of the user.
- email
Verified boolean Boolean. Indicates whether the email address has been verified.
- family
Name string - given
Name string - name string
- nickname string
String. Preferred nickname or alias of the user.
- password string
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone
Number string String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone
Verified boolean Boolean. Indicates whether the phone number has been verified.
- picture string
- roles string[]
Set(String). Set of IDs of roles assigned to the user.
- user
Id string String. ID of the user.
- user
Metadata string String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username string
String. Username of the user. Only valid if the connection requires a username.
- verify
Email boolean Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- app_
metadata str String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked bool
- connection_
name str String. Name of the connection from which the user information was sourced.
- email str
String. Email address of the user.
- email_
verified bool Boolean. Indicates whether the email address has been verified.
- family_
name str - given_
name str - name str
- nickname str
String. Preferred nickname or alias of the user.
- password str
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone_
number str String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone_
verified bool Boolean. Indicates whether the phone number has been verified.
- picture str
- roles Sequence[str]
Set(String). Set of IDs of roles assigned to the user.
- user_
id str String. ID of the user.
- user_
metadata str String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username str
String. Username of the user. Only valid if the connection requires a username.
- verify_
email bool Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
- app
Metadata String String, JSON format. Custom fields that store info about the user that impact the user's core functionality, such as how an application functions or what the user can access. Examples include support plans and IDs for external accounts.
- blocked Boolean
- connection
Name String String. Name of the connection from which the user information was sourced.
- email String
String. Email address of the user.
- email
Verified Boolean Boolean. Indicates whether the email address has been verified.
- family
Name String - given
Name String - name String
- nickname String
String. Preferred nickname or alias of the user.
- password String
String, Case-sensitive. Initial password for this user. Required for non-passwordless connections (SMS and email).
- phone
Number String String. Phone number for the user; follows the E.164 recommendation. Used for SMS connections.
- phone
Verified Boolean Boolean. Indicates whether the phone number has been verified.
- picture String
- roles List<String>
Set(String). Set of IDs of roles assigned to the user.
- user
Id String String. ID of the user.
- user
Metadata String String, JSON format. Custom fields that store info about the user that does not impact a user's core functionality. Examples include work address, home address, and user preferences.
- username String
String. Username of the user. Only valid if the connection requires a username.
- verify
Email Boolean Boolean. Indicates whether the user will receive a verification email after creation. Overrides behavior of
email_verified
parameter.
Import
auth0_user can be imported using the user ID, e.g.
$ pulumi import auth0:index/user:User user auth0|111111111111111111111111
Package Details
- Repository
- https://github.com/pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
auth0
Terraform Provider.