management

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncludeTotals

func IncludeTotals(include bool) reqOption

IncludeTotals configures a call to include totals.

func Page

func Page(page int) reqOption

Page configures a call to receive a specific page, if the results where concatenated.

func Parameter

func Parameter(key, value string) reqOption

Parameter is a generic configuration to add arbitrary query parameters to calls made to Auth0.

func PerPage

func PerPage(items int) reqOption

PerPage configures a call to limit the amount of items in the result.

func WithContext added in v1.3.0

func WithContext(ctx context.Context) apiOption

WitContext configures the management client to use the provided context instead of the provided one.

func WithDebug

func WithDebug(d bool) apiOption

WithDebug configures the management client to dump http requests and responses to stdout.

func WithFields

func WithFields(fields ...string) reqOption

WithFields configures a call to include the desired fields.

func WithTimeout

func WithTimeout(t time.Duration) apiOption

WithTimeout configures the management client with a request timeout.

func WithoutFields

func WithoutFields(fields ...string) reqOption

WithoutFields configures a call to exclude the desired fields.

Types

type BlacklistManager added in v1.3.0

type BlacklistManager struct {
	// contains filtered or unexported fields
}

func NewBlacklistManager added in v1.3.0

func NewBlacklistManager(m *Management) *BlacklistManager

func (*BlacklistManager) List added in v1.3.0

func (bm *BlacklistManager) List() (bl []*BlacklistToken, err error)

func (*BlacklistManager) Update added in v1.3.0

func (bm *BlacklistManager) Update(bt *BlacklistToken) error

type BlacklistToken added in v1.3.0

type BlacklistToken struct {

	// The "aud" (audience) claim identifies the recipients that the JWT is
	// intended for.
	//
	// See: https://tools.ietf.org/html/rfc7519#section-4.1.3
	Audience string `json:"aud,omitempty"`

	// The "jti" (JWT ID) claim provides a unique (within "aud") identifier for
	// the JWT.
	//
	// See: https://tools.ietf.org/html/rfc7519#section-4.1.7
	JTI string `json:"jti,omitempty"`
}

type Branding added in v1.2.5

type Branding struct {
	// Change password page settings
	Colors *BrandingColors `json:"colors,omitempty"`

	// URL for the favicon. Must use HTTPS.
	FaviconURL *string `json:"favicon_url,omitempty"`

	// URL for the logo. Must use HTTPS.
	LogoURL *string `json:"logo_url,omitempty"`

	Font *BrandingFont `json:"font,omitempty"`
}

func (*Branding) String added in v1.2.5

func (branding *Branding) String() string

type BrandingColors added in v1.2.5

type BrandingColors struct {
	// Accent color
	Primary *string `json:"primary,omitempty"`
	// Page background color
	PageBackground *string `json:"page_background,omitempty"`
}

type BrandingFont added in v1.2.5

type BrandingFont struct {
	// URL for the custom font. Must use HTTPS.
	URL *string `json:"url,omitempty"`
}

type BrandingManager added in v1.2.5

type BrandingManager struct {
	// contains filtered or unexported fields
}

func NewBrandingManager added in v1.2.5

func NewBrandingManager(m *Management) *BrandingManager

func (*BrandingManager) Read added in v1.2.5

func (bm *BrandingManager) Read(opts ...reqOption) (*Branding, error)

func (*BrandingManager) Update added in v1.2.5

func (bm *BrandingManager) Update(t *Branding) (err error)

type Client

type Client struct {

	// The name of the client
	Name *string `json:"name,omitempty"`

	// Free text description of the purpose of the Client. (Max character length
	// is 140)
	Description *string `json:"description,omitempty"`

	// The id of the client
	ClientID *string `json:"client_id,omitempty"`

	// The client secret, it must not be public
	ClientSecret *string `json:"client_secret,omitempty"`

	// The type of application this client represents
	AppType *string `json:"app_type,omitempty"`

	// The URL of the client logo (recommended size: 150x150)
	LogoURI *string `json:"logo_uri,omitempty"`

	// Whether this client a first party client or not
	IsFirstParty *bool `json:"is_first_party,omitempty"`

	// Set header `auth0-forwarded-for` as trusted to be used as source
	// of end user ip for brute-force-protection on token endpoint.
	IsTokenEndpointIPHeaderTrusted *bool `json:"is_token_endpoint_ip_header_trusted,omitempty"`

	// Whether this client will conform to strict OIDC specifications
	OIDCConformant *bool `json:"oidc_conformant,omitempty"`

	// The URLs that Auth0 can use to as a callback for the client
	Callbacks      []interface{} `json:"callbacks,omitempty"`
	AllowedOrigins []interface{} `json:"allowed_origins,omitempty"`

	// A set of URLs that represents valid web origins for use with web message
	// response mode
	WebOrigins        []interface{}           `json:"web_origins,omitempty"`
	ClientAliases     []interface{}           `json:"client_aliases,omitempty"`
	AllowedClients    []interface{}           `json:"allowed_clients,omitempty"`
	AllowedLogoutURLs []interface{}           `json:"allowed_logout_urls,omitempty"`
	JWTConfiguration  *ClientJWTConfiguration `json:"jwt_configuration,omitempty"`

	// Client signing keys
	SigningKeys   []map[string]string `json:"signing_keys,omitempty"`
	EncryptionKey map[string]string   `json:"encryption_key,omitempty"`
	SSO           *bool               `json:"sso,omitempty"`

	// True to disable Single Sign On, false otherwise (default: false)
	SSODisabled *bool `json:"sso_disabled,omitempty"`

	// True if this client can be used to make cross-origin authentication
	// requests, false otherwise (default: false)
	CrossOriginAuth *bool `json:"cross_origin_auth,omitempty"`

	// List of acceptable Grant Types for this Client
	GrantTypes []interface{} `json:"grant_types,omitempty"`

	// URL for the location in your site where the cross origin verification
	// takes place for the cross-origin auth flow when performing Auth in your
	// own domain instead of Auth0 hosted login page
	CrossOriginLocation *string `json:"cross_origin_loc,omitempty"`

	// True if the custom login page is to be used, false otherwise. Defaults to
	// true
	CustomLoginPageOn      *bool                  `json:"custom_login_page_on,omitempty"`
	CustomLoginPage        *string                `json:"custom_login_page,omitempty"`
	CustomLoginPagePreview *string                `json:"custom_login_page_preview,omitempty"`
	FormTemplate           *string                `json:"form_template,omitempty"`
	Addons                 map[string]interface{} `json:"addons,omitempty"`

	// Defines the requested authentication method for the token endpoint.
	// Possible values are:
	// 	'none' (public client without a client secret),
	// 	'client_secret_post' (client uses HTTP POST parameters) or
	// 	'client_secret_basic' (client uses HTTP Basic)
	TokenEndpointAuthMethod *string                `json:"token_endpoint_auth_method,omitempty"`
	ClientMetadata          map[string]string      `json:"client_metadata,omitempty"`
	Mobile                  map[string]interface{} `json:"mobile,omitempty"`
}
Example
m, err := management.New(domain, id, secret)
if err != nil {
	fmt.Printf("Failed creating management client. %s", err)
}

c := &management.Client{
	Name:        auth0.String("Client Name"),
	Description: auth0.String("Long description of client"),
}

err = m.Client.Create(c)
if err != nil {
	fmt.Printf("Failed creating client. %s", err)
}
defer m.Client.Delete(auth0.StringValue(c.ClientID))

fmt.Print("Client created!")
Output:

Client created!

func (*Client) String

func (c *Client) String() string

type ClientGrant

type ClientGrant struct {

	// A generated string identifying the client grant.
	ID *string `json:"id,omitempty"`

	// The identifier of the client.
	ClientID *string `json:"client_id,omitempty"`

	// The audience.
	Audience *string `json:"audience,omitempty"`

	Scope []interface{} `json:"scope"`
}

func (*ClientGrant) String

func (c *ClientGrant) String() string

type ClientGrantManager

type ClientGrantManager struct {
	// contains filtered or unexported fields
}

func NewClientGrantManager

func NewClientGrantManager(m *Management) *ClientGrantManager

func (*ClientGrantManager) Create

func (cg *ClientGrantManager) Create(g *ClientGrant) (err error)

func (*ClientGrantManager) Delete

func (cg *ClientGrantManager) Delete(id string) (err error)

func (*ClientGrantManager) List added in v1.3.0

func (cg *ClientGrantManager) List(opts ...reqOption) (gs []*ClientGrant, err error)

func (*ClientGrantManager) Read

func (cg *ClientGrantManager) Read(id string) (*ClientGrant, error)

func (*ClientGrantManager) Update

func (cg *ClientGrantManager) Update(id string, g *ClientGrant) (err error)

type ClientJWTConfiguration

type ClientJWTConfiguration struct {
	// The amount of seconds the JWT will be valid (affects exp claim)
	LifetimeInSeconds *int `json:"lifetime_in_seconds,omitempty"`

	// True if the client secret is base64 encoded, false otherwise. Defaults to
	// true
	SecretEncoded *bool `json:"secret_encoded,omitempty"`

	Scopes interface{} `json:"scopes,omitempty"`

	// Algorithm used to sign JWTs. Can be "HS256" or "RS256"
	Algorithm *string `json:"alg,omitempty"`
}

type ClientManager

type ClientManager struct {
	// contains filtered or unexported fields
}

func NewClientManager

func NewClientManager(m *Management) *ClientManager

func (*ClientManager) Create

func (cm *ClientManager) Create(c *Client) (err error)

func (*ClientManager) Delete

func (cm *ClientManager) Delete(id string) (err error)

func (*ClientManager) List

func (cm *ClientManager) List(opts ...reqOption) ([]*Client, error)

func (*ClientManager) Read

func (cm *ClientManager) Read(id string, opts ...reqOption) (*Client, error)

func (*ClientManager) RotateSecret

func (cm *ClientManager) RotateSecret(id string) (*Client, error)

func (*ClientManager) Update

func (cm *ClientManager) Update(id string, c *Client) (err error)

type Connection

type Connection struct {
	// A generated string identifying the connection.
	ID *string `json:"id,omitempty"`

	// The name of the connection. Must start and end with an alphanumeric
	// character and can only contain alphanumeric characters and '-'. Max
	// length 128.
	Name *string `json:"name,omitempty"`

	// The identity provider identifier for the connection. Can be any of the
	// following:
	//
	// "ad", "adfs", "amazon", "dropbox", "bitbucket", "aol", "auth0-adldap",
	// "auth0-oidc", "auth0", "baidu", "bitly", "box", "custom", "daccount",
	// "dwolla", "email", "evernote-sandbox", "evernote", "exact", "facebook",
	// "fitbit", "flickr", "github", "google-apps", "google-oauth2", "guardian",
	//  "instagram", "ip", "linkedin", "miicard", "oauth1", "oauth2",
	// "office365", "paypal", "paypal-sandbox", "pingfederate",
	// "planningcenter", "renren", "salesforce-community", "salesforce-sandbox",
	//  "salesforce", "samlp", "sharepoint", "shopify", "sms", "soundcloud",
	// "thecity-sandbox", "thecity", "thirtysevensignals", "twitter", "untappd",
	//  "vkontakte", "waad", "weibo", "windowslive", "wordpress", "yahoo",
	// "yammer" or "yandex".
	Strategy *string `json:"strategy,omitempty"`

	// True if the connection is domain level
	IsDomainConnection *bool `json:"is_domain_connection,omitempty"`

	// Options for validation.
	Options *ConnectionOptions `json:"options,omitempty"`

	// The identifiers of the clients for which the connection is to be
	// enabled. If the array is empty or the property is not specified, no
	// clients are enabled.
	EnabledClients []interface{} `json:"enabled_clients,omitempty"`

	// Defines the realms for which the connection will be used (ie: email
	// domains). If the array is empty or the property is not specified, the
	// connection name will be added as realm.
	Realms []interface{} `json:"realms,omitempty"`

	Metadata *interface{} `json:"metadata,omitempty"`
}

func (*Connection) String

func (c *Connection) String() string

type ConnectionManager

type ConnectionManager struct {
	// contains filtered or unexported fields
}

func NewConnectionManager

func NewConnectionManager(m *Management) *ConnectionManager

func (*ConnectionManager) Create

func (cm *ConnectionManager) Create(c *Connection) error

func (*ConnectionManager) Delete

func (cm *ConnectionManager) Delete(id string) (err error)

func (*ConnectionManager) GetConnectionID added in v1.2.5

func (cm *ConnectionManager) GetConnectionID(connectionName string) (*string, error)

func (*ConnectionManager) List added in v1.2.0

func (cm *ConnectionManager) List(opts ...reqOption) ([]*Connection, error)

func (*ConnectionManager) Read

func (cm *ConnectionManager) Read(id string, opts ...reqOption) (*Connection, error)

func (*ConnectionManager) Update

func (cm *ConnectionManager) Update(id string, c *Connection) (err error)

type ConnectionOptions

type ConnectionOptions struct {
	// Options for validation.
	Validation map[string]interface{} `json:"validation,omitempty"`

	// Password strength level, can be one of:
	// "none", "low", "fair", "good", "excellent" or null.
	PasswordPolicy *string `json:"passwordPolicy,omitempty"`

	// Options for password history policy.
	PasswordHistory map[string]interface{} `json:"password_history,omitempty"`

	// Options for password expiration policy.
	PasswordNoPersonalInfo map[string]interface{} `json:"password_no_personal_info,omitempty"`

	// Options for password dictionary policy.
	PasswordDictionary map[string]interface{} `json:"password_dictionary,omitempty"`

	// Options for password complexity options.
	PasswordComplexityOptions map[string]interface{} `json:"password_complexity_options,omitempty"`

	APIEnableUsers               *bool `json:"api_enable_users,omitempty"`
	BasicProfile                 *bool `json:"basic_profile,omitempty"`
	ExtAdmin                     *bool `json:"ext_admin,omitempty"`
	ExtIsSuspended               *bool `json:"ext_is_suspended,omitempty"`
	ExtAgreedTerms               *bool `json:"ext_agreed_terms,omitempty"`
	ExtGroups                    *bool `json:"ext_groups,omitempty"`
	ExtNestedGroups              *bool `json:"ext_nested_groups,omitempty"`
	ExtAssignedPlans             *bool `json:"ext_assigned_plans,omitempty"`
	ExtProfile                   *bool `json:"ext_profile,omitempty"`
	EnabledDatabaseCustomization *bool `json:"enabledDatabaseCustomization,omitempty"`
	BruteForceProtection         *bool `json:"brute_force_protection,omitempty"`
	ImportMode                   *bool `json:"import_mode,omitempty"`
	DisableSignup                *bool `json:"disable_signup,omitempty"`
	RequiresUsername             *bool `json:"requires_username,omitempty"`

	// Options for adding parameters in the request to the upstream IdP.
	UpstreamParams *interface{} `json:"upstream_params,omitempty"`

	ClientID            *string       `json:"client_id,omitempty"`
	ClientSecret        *string       `json:"client_secret,omitempty"`
	TenantDomain        *string       `json:"tenant_domain,omitempty"`
	DomainAliases       []interface{} `json:"domain_aliases,omitempty"`
	UseWsfed            *bool         `json:"use_wsfed,omitempty"`
	WaadProtocol        *string       `json:"waad_protocol,omitempty"`
	WaadCommonEndpoint  *bool         `json:"waad_common_endpoint,omitempty"`
	AppID               *string       `json:"app_id,omitempty"`
	AppDomain           *string       `json:"app_domain,omitempty"`
	MaxGroupsToRetrieve *string       `json:"max_groups_to_retrieve,omitempty"`

	// Scripts for the connection
	// Allowed keys are: "get_user", "login", "create", "verify", "change_password", "delete" or "change_email".
	CustomScripts map[string]interface{} `json:"customScripts,omitempty"`
	// configuration variables that can be used in custom scripts
	Configuration map[string]interface{} `json:"configuration,omitempty"`

	// Options to add integration with Twilio
	// https://community.auth0.com/t/using-management-api-to-create-a-twilio-connection/23576/3
	Totp                *ConnectionOptionsTotp `json:"totp,omitempty"`
	Name                *string                `json:"name,omitempty"`
	TwilioSid           *string                `json:"twilio_sid,omitempty"`
	TwilioToken         *string                `json:"twilio_token,omitempty"`
	From                *string                `json:"from,omitempty"`
	Syntax              *string                `json:"syntax,omitempty"`
	Template            *string                `json:"template,omitempty"`
	MessagingServiceSid *string                `json:"messaging_service_sid,omitempty"`

	// Adfs
	AdfsServer *string `json:"adfs_server,omitempty"`

	// Salesforce community
	CommunityBaseURL *string `json:"community_base_url"`
}

ConnectionOptions general options

type ConnectionOptionsTotp added in v1.2.1

type ConnectionOptionsTotp struct {
	TimeStep *int `json:"time_step,omitempty"`
	Length   *int `json:"length,omitempty"`
}

type CustomDomain

type CustomDomain struct {

	// The id of the custom domain
	ID *string `json:"custom_domain_id,omitempty"`

	// The custom domain.
	Domain *string `json:"domain,omitempty"`

	// The custom domain provisioning type. Can be either "auth0_managed_certs"
	// or "self_managed_certs"
	Type *string `json:"type,omitempty"`

	// Primary is true if the domain was marked as "primary", false otherwise.
	Primary *bool `json:"primary,omitempty"`

	// The custom domain configuration status. Can be any of the following:
	//
	// "disabled", "pending", "pending_verification" or "ready"
	Status *string `json:"status,omitempty"`

	// The custom domain verification method. The only allowed value is "txt".
	VerificationMethod *string `json:"verification_method,omitempty"`

	Verification *CustomDomainVerification `json:"verification,omitempty"`
}

func (*CustomDomain) String

func (c *CustomDomain) String() string

type CustomDomainManager

type CustomDomainManager struct {
	// contains filtered or unexported fields
}

func NewCustomDomainManager

func NewCustomDomainManager(m *Management) *CustomDomainManager

func (*CustomDomainManager) Create

func (cm *CustomDomainManager) Create(c *CustomDomain) (err error)

func (*CustomDomainManager) Delete

func (cm *CustomDomainManager) Delete(id string) (err error)

func (*CustomDomainManager) Read

func (cm *CustomDomainManager) Read(id string, opts ...reqOption) (*CustomDomain, error)

func (*CustomDomainManager) Update

func (cm *CustomDomainManager) Update(id string, c *CustomDomain) (err error)

type CustomDomainVerification

type CustomDomainVerification struct {

	// The custom domain verification methods.
	Methods []map[string]interface{} `json:"methods,omitempty"`
}

type DailyStat

type DailyStat struct {
	Date            *time.Time `json:"date"`
	Logins          *int       `json:"logins"`
	Signups         *int       `json:"signups"`
	LeakedPasswords *int       `json:"leaked_passwords"`
	UpdatedAt       *time.Time `json:"updated_at"`
	CreatedAt       *time.Time `json:"created_at"`
}

func (*DailyStat) String

func (ds *DailyStat) String() string

type Email

type Email struct {

	// The name of the email provider. Can be one of "mandrill", "sendgrid",
	// "sparkpost", "ses" or "smtp".
	Name *string `json:"name,omitempty"`

	// True if the email provider is enabled, false otherwise (defaults to true)
	Enabled *bool `json:"enabled,omitempty"`

	// The default FROM address
	DefaultFromAddress *string `json:"default_from_address,omitempty"`

	Credentials *EmailCredentials      `json:"credentials,omitempty"`
	Settings    map[string]interface{} `json:"settings,omitempty"`
}

func (*Email) String

func (e *Email) String() string

type EmailCredentials

type EmailCredentials struct {
	// API User
	APIUser *string `json:"api_user,omitempty"`
	// API Key
	APIKey *string `json:"api_key,omitempty"`
	// AWS Access Key ID
	AccessKeyID *string `json:"accessKeyId,omitempty"`
	// AWS Secret Access Key
	SecretAccessKey *string `json:"secretAccessKey,omitempty"`
	// AWS default region
	Region *string `json:"region,omitempty"`
	// SMTP host
	SMTPHost *string `json:"smtp_host,omitempty"`
	// SMTP port
	SMTPPort *int `json:"smtp_port,omitempty"`
	// SMTP user
	SMTPUser *string `json:"smtp_user,omitempty"`
	// SMTP password
	SMTPPass *string `json:"smtp_pass,omitempty"`
}

type EmailManager

type EmailManager struct {
	// contains filtered or unexported fields
}

func NewEmailManager

func NewEmailManager(m *Management) *EmailManager

func (*EmailManager) Create

func (em *EmailManager) Create(e *Email) error

func (*EmailManager) Delete

func (em *EmailManager) Delete() (err error)

func (*EmailManager) Read

func (em *EmailManager) Read(opts ...reqOption) (*Email, error)

func (*EmailManager) Update

func (em *EmailManager) Update(e *Email) (err error)

type EmailTemplate

type EmailTemplate struct {

	// The template name. Can be one of "verify_email", "reset_email",
	// "welcome_email", "blocked_account", "stolen_credentials",
	// "enrollment_email", "change_password", "password_reset" or
	// "mfa_oob_code".
	Template *string `json:"template"`

	// The body of the template.
	Body *string `json:"body,omitempty"`

	// The sender of the email.
	From *string `json:"from,omitempty"`

	// The URL to redirect the user to after a successful action.
	ResultURL *string `json:"resultUrl,omitempty"`

	// The subject of the email.
	Subject *string `json:"subject,omitempty"`

	// The syntax of the template body.
	Syntax *string `json:"syntax,omitempty"`

	// The lifetime in seconds that the link within the email will be valid for.
	URLLifetimeInSecoonds *int `json:"urlLifetimeInSeconds,omitempty"`

	// Whether or not the template is enabled.
	Enabled *bool `json:"enabled"`
}

func (*EmailTemplate) String

func (e *EmailTemplate) String() string

type EmailTemplateManager

type EmailTemplateManager struct {
	// contains filtered or unexported fields
}

func NewEmailTemplateManager

func NewEmailTemplateManager(m *Management) *EmailTemplateManager

func (*EmailTemplateManager) Create

func (em *EmailTemplateManager) Create(e *EmailTemplate) error

func (*EmailTemplateManager) Read

func (em *EmailTemplateManager) Read(template string, opts ...reqOption) (*EmailTemplate, error)

func (*EmailTemplateManager) Replace

func (em *EmailTemplateManager) Replace(template string, e *EmailTemplate) (err error)

func (*EmailTemplateManager) Update

func (em *EmailTemplateManager) Update(template string, e *EmailTemplate) (err error)

type Error

type Error interface {
	Status() int
	error
}

type Grant

type Grant struct {

	// The id of the grant.
	ID *string `json:"id,omitempty"`

	// The id of the client.
	ClientID *string `json:"clientID,omitempty"`

	// The id of the user.
	UserID *string `json:"user_id"`

	// The grant's audience.
	Audience *string `json:"audience,omitempty"`

	Scope []interface{} `json:"scope,omitempty"`
}

func (*Grant) String

func (g *Grant) String() string

type GrantManager

type GrantManager struct {
	// contains filtered or unexported fields
}

func NewGrantManager

func NewGrantManager(m *Management) *GrantManager

func (*GrantManager) List

func (gm *GrantManager) List(opts ...reqOption) ([]*Grant, error)

type GuardianManager added in v1.3.0

type GuardianManager struct {
	MultiFactor *MultiFactorManager
}

func NewGuardianManager added in v1.3.0

func NewGuardianManager(m *Management) *GuardianManager

type Identity added in v1.2.4

type Identity struct {
	Connection *string `json:"connection,omitempty"`
	UserID     *string `json:"user_id,omitempty"`
	Provider   *string `json:"provider,omitempty"`
	IsSocial   *bool   `json:"isSocial,omitempty"`
}

type Job added in v1.1.0

type Job struct {
	// The job's identifier. Useful to retrieve its status
	ID *string `json:"id,omitempty"`
	// The job's status
	Status *string `json:"status,omitempty"`
	// The type of job
	Type *string `json:"type,omitempty"`
	// The date when the job was created.
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// The user_id of the user to whom the email will be sent
	UserID *string `json:"user_id,omitempty"`
	// The id of the client, if not provided the global one will be used
	ClientID *string `json:"cliend_id,omitempty"`

	// The id of the connection.
	ConnectionID *string `json:"connection_id,omitempty"`
	// The url to download the result of the job.
	Location *string `json:"location,omitempty"`
	// The percentage of the work done so far.
	PercentageDone *int `json:"percentage_done,omitempty"`
	// Estimated amount of time remaining to finish the job.
	TimeLeftSeconds *int `json:"time_left_seconds,omitempty"`
	// The format of the file. Valid values are: "json" and "csv".
	Format *string `json:"format,omitempty"`
	// Limit the number of records.
	Limit *int `json:"limit,omitempty"`
	// A list of fields to be included in the CSV. If omitted, a set of
	// predefined fields will be exported.
	Fields []map[string]interface{} `json:"fields,omitempty"`

	// A list of users. Used when importing users in bulk.
	Users []map[string]interface{} `json:"users,omitempty"`
	// If false, users will only be inserted. If there are already user(s) with
	// the same emails as one or more of those being inserted, they will fail.
	// If this value is set to true and the user being imported already exists,
	// the user will be updated with the new information.
	Upsert *bool `json:"upsert,omitempty"`
	// Optional user defined string that can be used for correlating multiple
	// jobs, and is returned as part of the job status response.
	ExternalID *string `json:"external_id,omitempty"`
	// When true, sends a completion email to all tenant owners when the job is
	// finished. The default is true, so you must explicitly set this parameter
	// to false if you do not want emails sent.
	SendCompletionEmail *bool `json:"send_completion_email,omitempty"`
}

func (*Job) String added in v1.1.0

func (j *Job) String() string

type JobManager added in v1.1.0

type JobManager struct {
	// contains filtered or unexported fields
}

func NewJobManager added in v1.1.0

func NewJobManager(m *Management) *JobManager

func (*JobManager) ExportUsers added in v1.1.0

func (jm *JobManager) ExportUsers(j *Job) error

func (*JobManager) ImportUsers added in v1.1.0

func (jm *JobManager) ImportUsers(j *Job) error

func (*JobManager) Read added in v1.1.0

func (jm *JobManager) Read(id string, opts ...reqOption) (*Job, error)

func (*JobManager) VerifyEmail added in v1.1.0

func (jm *JobManager) VerifyEmail(j *Job) error

type Log

type Log struct {
	ID    *string `json:"_id"`
	LogID *string `json:"log_id"`

	// The date when the event was created
	Date *time.Time `json:"date"`

	// The log event type
	Type *string `json:"type"`

	// The id of the client
	ClientID *string `json:"client_id"`

	// The name of the client
	ClientName *string `json:"client_name"`

	// The IP of the log event source
	IP *string `json:"ip"`

	LocationInfo map[string]interface{} `json:"location_info"`
	Details      map[string]interface{} `json:"details"`

	// The user's unique identifier
	UserID *string `json:"user_id"`
}

func (*Log) String

func (l *Log) String() string

func (*Log) TypeName

func (l *Log) TypeName() string

type LogManager

type LogManager struct {
	// contains filtered or unexported fields
}

func NewLogManager

func NewLogManager(m *Management) *LogManager

func (*LogManager) List

func (lm *LogManager) List(opts ...reqOption) ([]*Log, error)

func (*LogManager) Read

func (lm *LogManager) Read(id string, opts ...reqOption) (*Log, error)

func (*LogManager) Search

func (lm *LogManager) Search(opts ...reqOption) ([]*Log, error)

type Management

type Management struct {
	// Client manages Auth0 Client (also known as Application) resources.
	Client *ClientManager

	// ClientGrant manages Auth0 ClientGrant resources.
	ClientGrant *ClientGrantManager

	// ResourceServer manages Auth0 Resource Server (also known as API)
	// resources.
	ResourceServer *ResourceServerManager

	// Connection manages Auth0 Connection resources.
	Connection *ConnectionManager

	// CustomDomain manages Auth0 Custom Domains.
	CustomDomain *CustomDomainManager

	// Grant manages Auth0 Grants.
	Grant *GrantManager

	// Log reads Auth0 Logs.
	Log *LogManager

	// RoleManager manages Auth0 Roles.
	Role *RoleManager

	// RuleManager manages Auth0 Rules.
	Rule *RuleManager

	// RuleManager manages Auth0 Rule Configurations.
	RuleConfig *RuleConfigManager

	// Email manages Auth0 Email Providers.
	Email *EmailManager

	// EmailTemplate manages Auth0 Email Templates.
	EmailTemplate *EmailTemplateManager

	// User manages Auth0 User resources.
	User *UserManager

	// Job manages Auth0 jobs.
	Job *JobManager

	// Tenant manages your Auth0 Tenant.
	Tenant *TenantManager

	// Ticket creates verify email or change password tickets.
	Ticket *TicketManager

	// Stat is used to retrieve usage statistics.
	Stat *StatManager

	// Branding settings such as company logo or primary color.
	Branding *BrandingManager

	// Guardian manages your Auth0 Guardian settings
	Guardian *GuardianManager

	// Prompt manages your prompt settings.
	Prompt *PromptManager

	// Blacklist manages the auth0 blacklists
	Blacklist *BlacklistManager
	// contains filtered or unexported fields
}

Management is an Auth0 management client used to interact with the Auth0 Management API v2.

func New

func New(domain, clientID, clientSecret string, options ...apiOption) (*Management, error)

New creates a new Auth0 Management client by authenticating using the supplied client id and secret.

type MultiFactor added in v1.3.0

type MultiFactor struct {
	// States if this factor is enabled
	Enabled *bool `json:"enabled,omitempty"`

	// Guardian Factor name
	Name *string `json:"name,omitempty"`

	// For factors with trial limits (e.g. SMS) states if those limits have been exceeded
	TrialExpired *bool `json:"trial_expired,omitempty"`
}

func (*MultiFactor) String added in v1.3.0

func (mfa *MultiFactor) String() string

type MultiFactorDUO added in v1.3.0

type MultiFactorDUO struct {
	// contains filtered or unexported fields
}

func (*MultiFactorDUO) Enable added in v1.3.0

func (em *MultiFactorDUO) Enable(enabled bool) error

type MultiFactorEmail added in v1.3.0

type MultiFactorEmail struct {
	// contains filtered or unexported fields
}

func (*MultiFactorEmail) Enable added in v1.3.0

func (em *MultiFactorEmail) Enable(enabled bool) error

type MultiFactorManager added in v1.3.0

type MultiFactorManager struct {
	SMS   *MultiFactorSMS
	Push  *MultiFactorPush
	Email *MultiFactorEmail
	DUO   *MultiFactorDUO
	OTP   *MultiFactorOTP
	// contains filtered or unexported fields
}

func (*MultiFactorManager) List added in v1.3.0

func (mfm *MultiFactorManager) List(opts ...reqOption) ([]*MultiFactor, error)

type MultiFactorOTP added in v1.3.0

type MultiFactorOTP struct {
	// contains filtered or unexported fields
}

func (*MultiFactorOTP) Enable added in v1.3.0

func (em *MultiFactorOTP) Enable(enabled bool) error

type MultiFactorProviderAmazonSNS added in v1.3.0

type MultiFactorProviderAmazonSNS struct {
	// AWS Access Key ID
	AccessKeyID *string `json:"aws_access_key_id,omitempty"`

	// AWS Secret Access Key ID
	SecretAccessKeyID *string `json:"aws_secret_access_key,omitempty"`

	// AWS Region
	Region *string `json:"aws_region,omitempty"`

	// SNS APNS Platform Application ARN
	APNSPlatformApplicationARN *string `json:"sns_apns_platform_application_arn,omitempty"`

	// SNS GCM Platform Application ARN
	GCMPlatformApplicationARN *string `json:"sns_gcm_platform_application_arn,omitempty"`
}

func (*MultiFactorProviderAmazonSNS) String added in v1.3.0

func (sns *MultiFactorProviderAmazonSNS) String() string

type MultiFactorProviderTwilio added in v1.3.0

type MultiFactorProviderTwilio struct {
	// From number
	From *string `json:"from,omitempty"`

	// Copilot SID
	MessagingServiceSid *string `json:"messaging_service_sid,omitempty"`

	// Twilio Authentication token
	AuthToken *string `json:"auth_token,omitempty"`

	// Twilio SID
	SID *string `json:"sid,omitempty"`
}

func (*MultiFactorProviderTwilio) String added in v1.3.0

func (twilio *MultiFactorProviderTwilio) String() string

type MultiFactorPush added in v1.3.0

type MultiFactorPush struct {
	// contains filtered or unexported fields
}

func (*MultiFactorPush) AmazonSNS added in v1.3.0

func (*MultiFactorPush) Enable added in v1.3.0

func (pm *MultiFactorPush) Enable(enabled bool) error

func (*MultiFactorPush) UpdateAmazonSNS added in v1.3.0

func (pm *MultiFactorPush) UpdateAmazonSNS(sc *MultiFactorProviderAmazonSNS) error

type MultiFactorSMS added in v1.3.0

type MultiFactorSMS struct {
	// contains filtered or unexported fields
}

func (*MultiFactorSMS) Enable added in v1.3.0

func (sm *MultiFactorSMS) Enable(enabled bool) error

func (*MultiFactorSMS) Template added in v1.3.0

func (sm *MultiFactorSMS) Template() (*MultiFactorSMSTemplate, error)

func (*MultiFactorSMS) Twilio added in v1.3.0

func (*MultiFactorSMS) UpdateTemplate added in v1.3.0

func (sm *MultiFactorSMS) UpdateTemplate(st *MultiFactorSMSTemplate) error

func (*MultiFactorSMS) UpdateTwilio added in v1.3.0

func (sm *MultiFactorSMS) UpdateTwilio(twilio *MultiFactorProviderTwilio) error

type MultiFactorSMSTemplate added in v1.3.0

type MultiFactorSMSTemplate struct {
	// Message sent to the user when they are invited to enroll with a phone number
	EnrollmentMessage *string `json:"enrollment_message,omitempty"`

	// Message sent to the user when they are prompted to verify their account
	VerificationMessage *string `json:"verification_message,omitempty"`
}

func (*MultiFactorSMSTemplate) String added in v1.3.0

func (sms *MultiFactorSMSTemplate) String() string

type Permission added in v1.2.0

type Permission struct {
	// The resource server that the permission is attached to.
	ResourceServerIdentifier *string `json:"resource_server_identifier,omitempty"`

	// The name of the resource server.
	ResourceServerName *string `json:"resource_server_name,omitempty"`

	// The name of the permission.
	Name *string `json:"permission_name,omitempty"`

	// The description of the permission.
	Description *string `json:"description,omitempty"`
}

type Prompt added in v1.3.0

type Prompt struct {
	// Which login experience to use. Can be `new` or `classic`.
	UniversalLoginExperience string `json:"universal_login_experience,omitempty"`
}

type PromptManager added in v1.3.0

type PromptManager struct {
	// contains filtered or unexported fields
}

func NewPromptManager added in v1.3.0

func NewPromptManager(m *Management) *PromptManager

func (*PromptManager) Read added in v1.3.0

func (pm *PromptManager) Read() (*Prompt, error)

func (*PromptManager) Update added in v1.3.0

func (pm *PromptManager) Update(p *Prompt) error

type ResourceServer

type ResourceServer struct {

	// A generated string identifying the resource server.
	ID *string `json:"id,omitempty"`

	// The name of the resource server. Must contain at least one character.
	// Does not allow '<' or '>'
	Name *string `json:"name,omitempty"`

	// The identifier of the resource server.
	Identifier *string `json:"identifier,omitempty"`

	// Scopes supported by the resource server.
	Scopes []*ResourceServerScope `json:"scopes,omitempty"`

	// The algorithm used to sign tokens ["HS256" or "RS256"].
	SigningAlgorithm *string `json:"signing_alg,omitempty"`

	// The secret used to sign tokens when using symmetric algorithms.
	SigningSecret *string `json:"signing_secret,omitempty"`

	// Allows issuance of refresh tokens for this entity.
	AllowOfflineAccess *bool `json:"allow_offline_access,omitempty"`

	// The amount of time in seconds that the token will be valid after being
	// issued.
	TokenLifetime *int `json:"token_lifetime,omitempty"`

	// The amount of time in seconds that the token will be valid after being
	// issued from browser based flows. Value cannot be larger than
	// token_lifetime.
	TokenLifetimeForWeb *int `json:"token_lifetime_for_web,omitempty"`

	// Flag this entity as capable of skipping consent.
	SkipConsentForVerifiableFirstPartyClients *bool `json:"skip_consent_for_verifiable_first_party_clients,omitempty"`

	// A URI from which to retrieve JWKs for this resource server used for
	// verifying the JWT sent to Auth0 for token introspection.
	VerificationLocation *string `json:"verificationLocation,omitempty"`

	Options map[string]interface{} `json:"options,omitempty"`

	// Enables the enforcement of the authorization policies.
	EnforcePolicies *bool `json:"enforce_policies,omitempty"`

	// The dialect for the access token ["access_token" or "access_token_authz"].
	TokenDialect *string `json:"token_dialect,omitempty"`
}

func (*ResourceServer) String

func (r *ResourceServer) String() string

type ResourceServerManager

type ResourceServerManager struct {
	// contains filtered or unexported fields
}

func NewResourceServerManager

func NewResourceServerManager(m *Management) *ResourceServerManager

func (*ResourceServerManager) Create

func (r *ResourceServerManager) Create(rs *ResourceServer) (err error)

func (*ResourceServerManager) Delete

func (r *ResourceServerManager) Delete(id string) (err error)

func (*ResourceServerManager) Read

func (r *ResourceServerManager) Read(id string, opts ...reqOption) (*ResourceServer, error)

func (*ResourceServerManager) Update

func (r *ResourceServerManager) Update(id string, rs *ResourceServer) (err error)

type ResourceServerScope

type ResourceServerScope struct {
	// The scope name. Use the format <action>:<resource> for example
	// 'delete:client_grants'.
	Value *string `json:"value,omitempty"`

	// Description of the scope
	Description *string `json:"description,omitempty"`
}

type Role added in v1.2.0

type Role struct {
	// A unique ID for the role.
	ID *string `json:"id,omitempty"`

	// The name of the role created.
	Name *string `json:"name,omitempty"`

	// A description of the role created.
	Description *string `json:"description,omitempty"`
}

func (*Role) String added in v1.2.0

func (r *Role) String() string

type RoleManager added in v1.2.0

type RoleManager struct {
	// contains filtered or unexported fields
}

func NewRoleManager added in v1.2.0

func NewRoleManager(m *Management) *RoleManager

func (*RoleManager) AssignPermissions added in v1.2.0

func (rm *RoleManager) AssignPermissions(id string, permissions ...*Permission) error

func (*RoleManager) AssignUsers added in v1.2.0

func (rm *RoleManager) AssignUsers(id string, users ...*User) error

func (*RoleManager) Create added in v1.2.0

func (rm *RoleManager) Create(r *Role) error

func (*RoleManager) Delete added in v1.2.0

func (rm *RoleManager) Delete(id string) (err error)

func (*RoleManager) List added in v1.2.0

func (rm *RoleManager) List(opts ...reqOption) ([]*Role, error)

func (*RoleManager) Permissions added in v1.2.0

func (rm *RoleManager) Permissions(id string, opts ...reqOption) ([]*Permission, error)

func (*RoleManager) Read added in v1.2.0

func (rm *RoleManager) Read(id string, opts ...reqOption) (*Role, error)

func (*RoleManager) UnassignPermissions added in v1.2.0

func (rm *RoleManager) UnassignPermissions(id string, permissions ...*Permission) error

func (*RoleManager) Update added in v1.2.0

func (rm *RoleManager) Update(id string, r *Role) (err error)

func (*RoleManager) Users added in v1.2.0

func (rm *RoleManager) Users(id string, opts ...reqOption) ([]*User, error)

type Rule

type Rule struct {

	// The rule's identifier.
	ID *string `json:"id,omitempty"`

	// The name of the rule. Can only contain alphanumeric characters, spaces
	// and '-'. Can neither start nor end with '-' or spaces.
	Name *string `json:"name,omitempty"`

	// A script that contains the rule's code.
	Script *string `json:"script,omitempty"`

	// The rule's order in relation to other rules. A rule with a lower order
	// than another rule executes first. If no order is provided it will
	// automatically be one greater than the current maximum.
	Order *int `json:"order,omitempty"`

	// Enabled should be set to true if the rule is enabled, false otherwise.
	Enabled *bool `json:"enabled,omitempty"`
}

func (*Rule) String

func (r *Rule) String() string

type RuleConfig

type RuleConfig struct {

	// The key for a RuleConfigs config
	Key *string `json:"key,omitempty"`

	// The value for the rules config
	Value *string `json:"value,omitempty"`
}

func (*RuleConfig) String

func (r *RuleConfig) String() string

type RuleConfigManager

type RuleConfigManager struct {
	// contains filtered or unexported fields
}

func NewRuleConfigManager

func NewRuleConfigManager(m *Management) *RuleConfigManager

func (*RuleConfigManager) Delete

func (rm *RuleConfigManager) Delete(key string) (err error)

func (*RuleConfigManager) Read

func (rm *RuleConfigManager) Read(key string) (*RuleConfig, error)

func (*RuleConfigManager) Upsert

func (rm *RuleConfigManager) Upsert(key string, r *RuleConfig) (err error)

type RuleManager

type RuleManager struct {
	// contains filtered or unexported fields
}

func NewRuleManager

func NewRuleManager(m *Management) *RuleManager

func (*RuleManager) Create

func (rm *RuleManager) Create(r *Rule) error

func (*RuleManager) Delete

func (rm *RuleManager) Delete(id string) (err error)

func (*RuleManager) Read

func (rm *RuleManager) Read(id string, opts ...reqOption) (*Rule, error)

func (*RuleManager) Update

func (rm *RuleManager) Update(id string, r *Rule) (err error)

type StatManager

type StatManager struct {
	// contains filtered or unexported fields
}

func NewStatManager

func NewStatManager(m *Management) *StatManager

func (*StatManager) ActiveUsers

func (sm *StatManager) ActiveUsers() (int, error)

func (*StatManager) Daily

func (sm *StatManager) Daily(opts ...reqOption) ([]*DailyStat, error)

type Tenant

type Tenant struct {
	// Change password page settings
	ChangePassword *TenantChangePassword `json:"change_password,omitempty"`

	// Guardian MFA page settings
	GuardianMFAPage *TenantGuardianMFAPage `json:"guardian_mfa_page,omitempty"`

	// Default audience for API Authorization
	DefaultAudience *string `json:"default_audience,omitempty"`

	// Name of the connection that will be used for password grants at the token
	// endpoint. Only the following connection types are supported: LDAP, AD,
	// Database Connections, Passwordless, Windows Azure Active Directory, ADFS.
	DefaultDirectory *string `json:"default_directory,omitempty"`

	ErrorPage *TenantErrorPage `json:"error_page,omitempty"`

	Flags *TenantFlags `json:"flags,omitempty"`

	// The friendly name of the tenant
	FriendlyName *string `json:"friendly_name,omitempty"`

	// The URL of the tenant logo (recommended size: 150x150)
	PictureURL *string `json:"picture_url,omitempty"`

	// User support email
	SupportEmail *string `json:"support_email,omitempty"`

	// User support URL
	SupportURL *string `json:"support_url,omitempty"`

	// A set of URLs that are valid to redirect to after logout from Auth0.
	AllowedLogoutURLs []interface{} `json:"allowed_logout_urls,omitempty"`

	// Login session lifetime, how long the session will stay valid (unit:
	// hours).
	SessionLifetime *int `json:"session_lifetime,omitempty"`

	// The selected sandbox version to be used for the extensibility environment
	SandboxVersion *string `json:"sandbox_version,omitempty"`

	// A set of available sandbox versions for the extensibility environment
	SandboxVersionAvailable []interface{} `json:"sandbox_versions_available,omitempty"`

	// Force a user to login after they have been inactive for the specified number (unit: hours)
	IdleSessionLifetime *int `json:"idle_session_lifetime,omitempty"`

	// Used to store additional metadata
	UniversalLogin *TenantUniversalLogin `json:"universal_login,omitempty"`

	// Supported locales for the UI
	EnabledLocales []interface{} `json:"enabled_locales,omitempty"`

	DeviceFlow *TenantDeviceFlow `json:"device_flow,omitempty"`
}

func (*Tenant) String

func (t *Tenant) String() string

type TenantChangePassword

type TenantChangePassword struct {
	// True to use the custom change password html, false otherwise.
	Enabled *bool `json:"enabled,omitempty"`
	// Replace default change password page with a custom HTML (Liquid syntax is
	// supported).
	HTML *string `json:"html,omitempty"`
}

type TenantDeviceFlow added in v1.2.5

type TenantDeviceFlow struct {
	// The character set for generating a User Code ['base20' or 'digits']
	Charset *string `json:"charset,omitempty"`

	// The mask used to format the generated User Code to a friendly, readable format with possible spaces or hyphens
	Mask *string `json:"mask,omitempty"`
}

type TenantErrorPage

type TenantErrorPage struct {
	// Replace default error page with a custom HTML (Liquid syntax is
	// supported).
	HTML *string `json:"html,omitempty"`
	// True to show link to log as part of the default error page, false
	// otherwise (default: true).
	ShowLogLink *bool `json:"show_log_link,omitempty"`
	// Redirect to specified url instead of show the default error page
	URL *string `json:"url,omitempty"`
}

type TenantFlags

type TenantFlags struct {
	// Enables the first version of the Change Password flow. We've deprecated
	// this option and recommending a safer flow. This flag is only for
	// backwards compatibility.
	ChangePasswordFlowV1 *bool `json:"change_pwd_flow_v1,omitempty"`

	// This flag determines whether all current connections shall be enabled
	// when a new client is created. Default value is true.
	EnableClientConnections *bool `json:"enable_client_connections,omitempty"`

	// This flag enables the API section in the Auth0 Management Dashboard.
	EnableAPIsSection *bool `json:"enable_apis_section,omitempty"`

	// If set to true all Impersonation functionality is disabled for the
	// Tenant. This is a read-only attribute.
	DisableImpersonation *bool `json:"disable_impersonation,omitempty"`

	// This flag enables advanced API Authorization scenarios.
	EnablePipeline2 *bool `json:"enable_pipeline2,omitempty"`

	// This flag enables dynamic client registration.
	EnableDynamicClientRegistration *bool `json:"enable_dynamic_client_registration,omitempty"`

	// If enabled, All your email links and urls will use your configured custom
	// domain. If no custom domain is found the email operation will fail.
	EnableCustomDomainInEmails *bool `json:"enable_custom_domain_in_emails,omitempty"`

	// If enabled, users will not be prompted to confirm log in before SSO redirection.
	EnableSSO *bool `json:"enable_sso,omitempty"`

	AllowChangingEnableSso *bool `json:"allow_changing_enable_sso,omitempty"`

	// If enabled, activate the new look and feel for Universal Login
	UniversalLogin *bool `json:"universal_login,omitempty"`

	// If enabled, the legacy Logs Search Engine V2 will be enabled for your account.
	// Turn it off to opt-in for the latest Logs Search Engine V3.
	EnableLegacyLogsSearchV2 *bool `json:"enable_legacy_logs_search_v2,omitempty"`

	// If enabled, additional HTTP security headers will not be included in the response
	// to prevent embedding of the Universal Login prompts in an IFRAME.
	DisableClickjackProtectionHeaders *bool `json:"disable_clickjack_protection_headers,omitempty"`

	// If enabled, this will use a generic response in the public signup API
	// which will prevent users from being able to find out if an e-mail address or username has previously registered
	EnablePublicSignupUserExistsError *bool `json:"enable_public_signup_user_exists_error,omitempty"`
}

type TenantGuardianMFAPage

type TenantGuardianMFAPage struct {
	// True to use the custom html for Guardian page, false otherwise.
	Enabled *bool `json:"enabled,omitempty"`
	// Replace default Guardian page with a custom HTML (Liquid syntax is
	// supported).
	HTML *string `json:"html,omitempty"`
}

type TenantManager

type TenantManager struct {
	// contains filtered or unexported fields
}

func NewTenantManager

func NewTenantManager(m *Management) *TenantManager

func (*TenantManager) Read

func (tm *TenantManager) Read(opts ...reqOption) (*Tenant, error)

func (*TenantManager) Update

func (tm *TenantManager) Update(t *Tenant) (err error)

type TenantUniversalLogin added in v1.2.5

type TenantUniversalLogin struct {
	Colors *TenantUniversalLoginColors `json:"colors,omitempty"`
}

type TenantUniversalLoginColors added in v1.2.5

type TenantUniversalLoginColors struct {
	// Primary button background color
	Primary *string `json:"primary,omitempty"`

	// Background color of your login pages
	PageBackground *string `json:"page_background,omitempty"`
}

type Ticket

type Ticket struct {
	// The user will be redirected to this endpoint once the ticket is used
	ResultURL *string `json:"result_url,omitempty"`

	// The UserID for which the ticket is to be created
	UserID *string `json:"user_id,omitempty"`

	// The ticket's lifetime in seconds starting from the moment of creation.
	// After expiration the ticket can not be used to verify the users's email.
	// If not specified or if you send 0 the Auth0 default lifetime will be
	// applied.
	TTLSec *int `json:"ttl_sec,omitempty"`

	// The connection that provides the identity for which the password is to be
	// changed. If sending this parameter, the email is also required and the
	// UserID is invalid.
	//
	// Requires: Email
	// Conflicts with: UserID
	ConnectionID *string `json:"connection_id,omitempty"`

	// The user's email
	//
	// Requires: ConnectionID
	// Conflicts with: UserID
	Email *string `json:"email,omitempty"`

	// The URL that represents the ticket
	Ticket *string `json:"ticket,omitempty"`

	// Whether to set the email_verified attribute to true (true) or whether it
	// should not be updated
	MarkEmailAsVerified *bool `json:"mark_email_as_verified,omitempty"`
}

func (*Ticket) String

func (t *Ticket) String() string

type TicketManager

type TicketManager struct {
	// contains filtered or unexported fields
}

func NewTicketManager

func NewTicketManager(m *Management) *TicketManager

func (*TicketManager) ChangePassword

func (tm *TicketManager) ChangePassword(t *Ticket) (*Ticket, error)

func (*TicketManager) VerifyEmail

func (tm *TicketManager) VerifyEmail(t *Ticket) (*Ticket, error)

type User

type User struct {

	// The users identifier.
	ID *string `json:"user_id,omitempty"`

	// The connection the user belongs to.
	Connection *string `json:"connection,omitempty"`

	// The user's email
	Email *string `json:"email,omitempty"`

	// The users name
	Name *string `json:"name,omitempty"`

	// The users given name
	GivenName *string `json:"given_name,omitempty"`

	// The users family name
	FamilyName *string `json:"family_name,omitempty"`

	// The user's username. Only valid if the connection requires a username
	Username *string `json:"username,omitempty"`

	// The user's nickname
	Nickname *string `json:"nickname,omitempty"`

	// The user's password (mandatory for non SMS connections)
	Password *string `json:"password,omitempty"`

	// The user's phone number (following the E.164 recommendation), only valid
	// for users to be added to SMS connections.
	PhoneNumber *string `json:"phone_number,omitempty"`

	// The time the user is created.
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// The last time the user is updated.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`

	// The last time the user has logged in.
	LastLogin *time.Time `json:"last_login,omitempty"`

	// UserMetadata holds data that the user has read/write access to (e.g.
	// color_preference, blog_url, etc).
	UserMetadata map[string]interface{} `json:"user_metadata,omitempty"`

	Identities []*Identity `json:"identities,omitempty"`

	// True if the user's email is verified, false otherwise. If it is true then
	// the user will not receive a verification email, unless verify_email: true
	// was specified.
	EmailVerified *bool `json:"email_verified,omitempty"`

	// If true, the user will receive a verification email after creation, even
	// if created with email_verified set to true. If false, the user will not
	// receive a verification email, even if created with email_verified set to
	// false. If unspecified, defaults to the behavior determined by the value
	// of email_verified.
	VerifyEmail *bool `json:"verify_email,omitempty"`

	// True if the user's phone number is verified, false otherwise. When the
	// user is added to a SMS connection, they will not receive an verification
	// SMS if this is true.
	PhoneVerified *bool `json:"phone_verified,omitempty"`

	// AppMetadata holds data that the user has read-only access to (e.g. roles,
	// permissions, vip, etc).
	AppMetadata map[string]interface{} `json:"app_metadata,omitempty"`

	// The user's picture url
	Picture *string `json:"picture,omitempty"`

	// True if the user is blocked from the application, false if the user is enabled
	Blocked *bool `json:"blocked,omitempty"`
}
Example
m, err := management.New(domain, id, secret)
if err != nil {
	fmt.Printf("Failed creating management client. %s", err)
}

u := &management.User{
	Connection: auth0.String("Username-Password-Authentication"),
	Email:      auth0.String("smith@example.com"),
	Username:   auth0.String("smith"),
	Password:   auth0.String("F4e3DA1a6cDD"),
}

err = m.User.Create(u)
if err != nil {
	fmt.Printf("Failed creating user. %s", err)
}
defer m.User.Delete(auth0.StringValue(u.ID))

fmt.Print("User created!")
Output:

User created!

func (*User) String

func (u *User) String() string

type UserManager

type UserManager struct {
	// contains filtered or unexported fields
}

func NewUserManager

func NewUserManager(m *Management) *UserManager

func (*UserManager) AssignPermissions added in v1.3.0

func (um *UserManager) AssignPermissions(id string, permissions ...*Permission) error

func (*UserManager) AssignRoles added in v1.2.0

func (um *UserManager) AssignRoles(id string, roles ...*Role) error

func (*UserManager) Create

func (um *UserManager) Create(u *User) error

func (*UserManager) Delete

func (um *UserManager) Delete(id string) (err error)

func (*UserManager) GetPermissions added in v1.3.0

func (um *UserManager) GetPermissions(id string, opts ...reqOption) (permissions []*Permission, err error)

func (*UserManager) GetRoles added in v1.2.0

func (um *UserManager) GetRoles(id string, opts ...reqOption) (roles []*Role, err error)

func (*UserManager) List

func (um *UserManager) List(opts ...reqOption) (us []*User, err error)

func (*UserManager) ListByEmail added in v1.2.0

func (um *UserManager) ListByEmail(email string, opts ...reqOption) (us []*User, err error)

func (*UserManager) Read

func (um *UserManager) Read(id string, opts ...reqOption) (*User, error)

func (*UserManager) Search

func (um *UserManager) Search(opts ...reqOption) (us []*User, err error)

func (*UserManager) UnassignPermissions added in v1.3.0

func (um *UserManager) UnassignPermissions(id string, permissions ...*Permission) error

func (*UserManager) UnassignRoles added in v1.2.0

func (um *UserManager) UnassignRoles(id string, roles ...*Role) error

func (*UserManager) Update

func (um *UserManager) Update(id string, u *User) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL