Skip to main content

Login Configuration

Manage login strategy configuration for Cloud Development environments, including login method toggles, SMS verification settings, MFA (Multi-Factor Authentication), and password update policies.

v3.1.0+

It is recommended to use tcb env login get and tcb env login set commands to manage login configuration. The legacy list/create/update subcommands have been deprecated and will be removed in future versions.

Query Login Strategy Configuration

Query the current environment's login strategy configuration, including the status of each login method, SMS verification settings, MFA configuration, and password update strategy:

tcb env login get -e <envId>

Parameters:

ParameterDescription
-e, --env-id <envId>Environment ID

Examples:

# Query login strategy configuration
tcb env login get -e env-xxx

# Output in JSON format
tcb env login get -e env-xxx --json

Output Description:

The command outputs the following configuration:

FieldDescription
Login Config
EmailLoginEmail login toggle
AnonymousLoginAnonymous login toggle
UserNameLoginUsername-password login toggle
PhoneNumberLoginPhone number SMS login toggle
SmsVerificationConfig
TypeSMS channel type
NameCustom APIs data source name
MethodSMS sending method
SmsDayLimitDaily sending limit
MfaConfig
OnWhether MFA is enabled
SmsWhether SMS MFA is enabled
EmailWhether email MFA is enabled
RequiredBindPhoneWhether phone binding is required
PwdUpdateStrategy
FirstLoginUpdateForce password change on first login
PeriodUpdateWhether periodic password change is enabled
PeriodValuePassword change period value
PeriodTypePassword change period unit

Modify Login Strategy Configuration

Modify the current environment's login strategy configuration. Parameters not specified will retain their current values:

tcb env login set -e <envId> [options]

Parameters:

Login Method Toggles:

ParameterDescriptionValues
--phone-number-login <value>Phone number SMS login toggletrue / false
--email-login <value>Email login toggletrue / false
--username-login <value>Username-password login toggletrue / false
--anonymous-login <value>Anonymous login toggletrue / false

SMS Verification Configuration (SmsVerificationConfig):

ParameterDescription
--sms-type <smsType>SMS channel type (e.g., default)
--sms-name <smsName>Custom APIs data source name
--sms-method <smsMethod>SMS sending method
--sms-day-limit <smsDayLimit>Daily sending limit (-1 for unlimited)

MFA Configuration (MfaConfig):

ParameterDescriptionValues
--mfa-on <value>Enable MFATRUE / FALSE
--mfa-sms <value>Enable SMS MFATRUE / FALSE
--mfa-email <value>Enable email MFATRUE / FALSE
--mfa-required-bind-phone <value>Require phone bindingTRUE / FALSE

Password Update Strategy (PwdUpdateStrategy):

ParameterDescriptionValues
--first-login-update <value>Force password change on first logintrue / false
--period-update <value>Enable periodic password changetrue / false
--period-value <value>Password change period valueNumber
--period-type <value>Password change period unitYEAR / MONTH / WEEK

Examples:

# Enable anonymous login
tcb env login set -e env-xxx --anonymous-login true

# Configure multiple login methods at once
tcb env login set -e env-xxx --phone-number-login true --username-login true --anonymous-login false

# Configure password update strategy: enable periodic change every 3 months
tcb env login set -e env-xxx --period-update true --period-value 3 --period-type MONTH

# Output in JSON format
tcb env login set -e env-xxx --anonymous-login true --json
Tips
  • The set command queries the current configuration first. Parameters not specified will retain their current values and won't be reset.
  • Login method toggles accept lowercase true/false, while MFA-related configurations accept uppercase TRUE/FALSE.

Legacy Commands (Deprecated)

Notice

The following commands are deprecated. Please migrate to tcb env login get / tcb env login set. Legacy commands will be removed in future versions.

View Login Methods (Deprecated)

tcb env login list

List the login methods configured for the environment. Use tcb env login get instead.

Create Login Methods (Deprecated)

tcb env login create

Interactively add login method configuration, supporting WeChat Official Account, WeChat Open Platform, and anonymous login.

Update Login Methods (Deprecated)

tcb env login update

Interactively modify existing login method configuration. Use tcb env login set instead.


Command Reference

CommandDescriptionVersion
tcb env login getQuery login strategy configurationv3.1.0+
tcb env login setModify login strategy configurationv3.1.0+
tcb env login listList login methods (deprecated)v1+
tcb env login createCreate login methods (deprecated)v1+
tcb env login updateUpdate login methods (deprecated)v1+