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.
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:
| Parameter | Description |
|---|---|
-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:
| Field | Description |
|---|---|
| Login Config | |
EmailLogin | Email login toggle |
AnonymousLogin | Anonymous login toggle |
UserNameLogin | Username-password login toggle |
PhoneNumberLogin | Phone number SMS login toggle |
| SmsVerificationConfig | |
Type | SMS channel type |
Name | Custom APIs data source name |
Method | SMS sending method |
SmsDayLimit | Daily sending limit |
| MfaConfig | |
On | Whether MFA is enabled |
Sms | Whether SMS MFA is enabled |
Email | Whether email MFA is enabled |
RequiredBindPhone | Whether phone binding is required |
| PwdUpdateStrategy | |
FirstLoginUpdate | Force password change on first login |
PeriodUpdate | Whether periodic password change is enabled |
PeriodValue | Password change period value |
PeriodType | Password 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:
| Parameter | Description | Values |
|---|---|---|
--phone-number-login <value> | Phone number SMS login toggle | true / false |
--email-login <value> | Email login toggle | true / false |
--username-login <value> | Username-password login toggle | true / false |
--anonymous-login <value> | Anonymous login toggle | true / false |
SMS Verification Configuration (SmsVerificationConfig):
| Parameter | Description |
|---|---|
--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):
| Parameter | Description | Values |
|---|---|---|
--mfa-on <value> | Enable MFA | TRUE / FALSE |
--mfa-sms <value> | Enable SMS MFA | TRUE / FALSE |
--mfa-email <value> | Enable email MFA | TRUE / FALSE |
--mfa-required-bind-phone <value> | Require phone binding | TRUE / FALSE |
Password Update Strategy (PwdUpdateStrategy):
| Parameter | Description | Values |
|---|---|---|
--first-login-update <value> | Force password change on first login | true / false |
--period-update <value> | Enable periodic password change | true / false |
--period-value <value> | Password change period value | Number |
--period-type <value> | Password change period unit | YEAR / 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
- The
setcommand 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 uppercaseTRUE/FALSE.
Legacy Commands (Deprecated)
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
| Command | Description | Version |
|---|---|---|
tcb env login get | Query login strategy configuration | v3.1.0+ |
tcb env login set | Modify login strategy configuration | v3.1.0+ |
tcb env login list | List login methods (deprecated) | v1+ |
tcb env login create | Create login methods (deprecated) | v1+ |
tcb env login update | Update login methods (deprecated) | v1+ |