Skip to main content

Manage Login Methods

Cloud Development provides multiple authentication methods, which you can flexibly configure according to business requirements.

Manually Enable Cloud Development Platform

  1. On the Cloud Development Platform, select the environment to be managed.
  2. Navigate to the "Authentication" > "Login Methods" page.
  3. In the login methods list, select the desired login method and click the enable/disable button to configure.

Enable via SDK

Supports managing the enabling and disabling of login methods through the Tencent Cloud SDK (tencentcloud-sdk), with support for multiple languages including java, go, and JavaScript.

tip

Enabling/disabling login methods via the Tencent Cloud SDK (tencentcloud-sdk) only affects the Cloud Development Platform login authentication v2 methods and does not synchronize the enabling/disabling of the legacy Cloud Development Console v1 login methods. Please go to the Cloud Development Console to manually enable/disable v1 login methods.

Supported login methods and parameters:

Login MethodParameterParameter Value
Phone Number Verification Code LoginPhoneNumberLoginTRUE, FALSE; TRUE for enabled, FALSE for disabled
Anonymous LoginAnonymousLoginTRUE, FALSE; TRUE for enabled, FALSE for disabled
Username and Password LoginUsernameLoginTRUE, FALSE; TRUE for enabled, FALSE for disabled
{
"EnvId": "your-env-id",
"PhoneNumberLogin": "TRUE",
"AnonymousLogin": "TRUE",
"UsernameLogin": "TRUE",
}

Sample code is provided below. To learn more about usage, visit Tencent Cloud API Explorer:

JavaScript language
const tencentcloud = require("tencentcloud-sdk-nodejs-tcb");
const TcbClient = tencentcloud.tcb.v20180608.Client;
// Instantiate an authentication object. The input parameters need to include Tencent Cloud account SecretId and SecretKey. Pay attention to keeping the confidentiality of the key pair.
// Code leakage may lead to the leakage of SecretId and SecretKey, threatening the security of all resources under the account. The following sample code is for reference only. It is recommended to use keys in a more secure way. See https://cloud.tencent.com/document/product/1278/85305.
// The key can be obtained at the official console https://console.cloud.tencent.com/cam/capi.
const clientConfig = {
credential: {
secretId: "",
secretKey: "",
},
region: "",
profile: {
httpProfile: {
endpoint: "tcb.tencentcloudapi.com",
},
},
};
// Instantiate the client object to request the product, and clientProfile is optional.
const client = new TcbClient(clientConfig);
const params = {};
client.EditAuthConfig(params).then(
(data) => {
console.log(data);
},
(err) => {
console.error("error", err);
}
);