Documentation ¶
Index ¶
- func RetryClient(c *http.Client) *http.Client
- type Client
- type ClientGrant
- type ClientGrantManager
- type ClientJWTConfiguration
- type ClientManager
- type Config
- type Connection
- type ConnectionManager
- type ConnectionOptions
- type CustomDomain
- type CustomDomainManager
- type CustomDomainVerification
- type Email
- type EmailCredentials
- type EmailManager
- type EmailTemplate
- type EmailTemplateManager
- type Error
- type Management
- type ResourceServer
- type ResourceServerManager
- type ResourceServerScope
- type Rule
- type RuleConfig
- type RuleConfigManager
- type RuleManager
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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"` // 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:"-"` 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"` }
type ClientGrant ¶
type ClientGrantManager ¶
type ClientGrantManager struct {
// contains filtered or unexported fields
}
func NewClientGrantManager ¶
func NewClientGrantManager(m *Management) *ClientGrantManager
func (*ClientGrantManager) Create ¶
func (r *ClientGrantManager) Create(g *ClientGrant) (err error)
func (*ClientGrantManager) Delete ¶
func (r *ClientGrantManager) Delete(id string) (err error)
func (*ClientGrantManager) Read ¶
func (r *ClientGrantManager) Read(id string) (*ClientGrant, error)
func (*ClientGrantManager) Update ¶
func (r *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)
type Config ¶
type Config struct { Audience string `json:"audience"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` GrantType string `json:"grant_type"` }
Config is the payload used to receive an Auth0 management token. This token is a JWT, it contains specific granted permissions (known as scopes), and it is signed with a application API key and secret for the entire tenant.
{ "audience": "https://YOUR_AUTH0_DOMAIN/api/v2/", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "grant_type": "client_credentials" }
See: https://auth0.com/docs/api/management/v2/tokens#1-get-a-token
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"` // 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"` }
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) Read ¶
func (cm *ConnectionManager) Read(id string) (*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"` 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"` ExtAssignedPlans bool `json:"ext_assigned_plans,omitempty"` ExtProfile bool `json:"ext_profile,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"` }
ConnectionOptions general options
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"` }
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) (*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 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"` }
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() (*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"` }
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) Delete ¶
func (em *EmailTemplateManager) Delete(template string) (err error)
func (*EmailTemplateManager) Read ¶
func (em *EmailTemplateManager) Read(template string) (*EmailTemplate, error)
func (*EmailTemplateManager) Update ¶
func (em *EmailTemplateManager) Update(template string, e *EmailTemplate) (err 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 // 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 // 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) (*Management, error)
New creates a new Auth0 Management client by authenticating using the supplied client id and secret.
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"` // 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"` }
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) (*ResourceServer, error)
func (*ResourceServerManager) Update ¶
func (r *ResourceServerManager) Update(id string, rs *ResourceServer) (err error)
type ResourceServerScope ¶
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"` }
type RuleConfig ¶
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)
type Token ¶
type Token struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` TokenType string `json:"token_type"` }
Token is the response body from the request to receive an Auth0 management token.
{ "access_token": "eyJ...Ggg", "expires_in": 86400, "scope": "read:clients create:clients read:client_keys", "token_type": "Bearer" }
See: https://auth0.com/docs/api/management/v2/tokens#2-use-the-token