tencent cloud

CloudBase

Product Introduction
Product Overview
Features and Strengths
Use Cases
System Limits
Purchase Guide
Product Pricing
Description Of Billing Capability Items
Yearly/Monthly Subscription Package Description
Alarm and Notification
Overdue Payment Instructions
Development Guide
Cloud Storage
Database
Identity Verification
Cloud function
Static website management
SDK Documentation
Client SDK
Server SDKs
Management-side SDK
Product Agreement
Cloud Development Service Level Agreement

Managing Login Methods

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-12-31 11:48:17
CloudBase provides multiple identity verification methods, and you can configure them flexibly based on your business needs.

Enabling CloudBase Platform Manually

1. In the CloudBase Platform, select the environment to be managed.
2. Go to the Identity Verification > Login Methods page.
3. In the login methods list, select the desired login method and click Enable/Disable to configure.

Enabling SDK Method

Enabling/disabling login methods through Tencent Cloud SDK (tencentcloud-SDK) is allowed, supporting multiple languages such as Java, Go, and JS.
Note:
Enabling/disabling login methods through Tencent Cloud SDK (tencentcloud-sdk) only enables/disables login methods for CloudBase Platform login authentication v2, and will not synchronously enable/disable the old CloudBase console v1 login methods. To enable/disable v1 login methods, go to the CloudBase console and operate manually.
Supported login methods and parameters:
Login Method
Parameter
Parameter
Login with phone number Captcha
PhoneNumberLogin
TRUE and FALSE, where TRUE represents enable and FALSE represents disable.
Anonymous login
AnonymousLogin
TRUE and FALSE, where TRUE represents enable and FALSE represents disable.
Login with username and password
UsernameLogin
TRUE and FALSE, where TRUE represents enable and FALSE represents disable.
{
"EnvId": "your-env-id",
"PhoneNumberLogin": "TRUE",
"AnonymousLogin": "TRUE",
"UsernameLogin": "TRUE",
}
Here is a sample code. For more usage methods, see Tencent Cloud API:
Go
JavaScript
Java

package main
import (
"fmt"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
tcb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcb/v20180608"
)
func main() {
// 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://www.tencentcloud.com/document/product/1278/85305?from_cn_redirect=1.
// The key can be obtained at the official console https://console.tencentcloud.com/cam/capi.
credential := common.NewCredential(
"",
"",
)
// Instantiate a client option, optional, which can be skipped if there is no special requirement.
cpf := profile.NewClientProfile()
cpf.HttpProfile.Endpoint = "tcb.tencentcloudapi.com"
// Instantiate the client object to request the product, and clientProfile is optional.
client, _ := tcb.NewClient(credential, "", cpf)
// Instantiate a request object. Each interface will correspond to a request object.
request := tcb.NewEditAuthConfigRequest()
// The returned resp is an instance of EditAuthConfigResponse, corresponding to the request object.
response, err := client.EditAuthConfig(request)
if _, ok := err.(*errors.TencentCloudSDKError); ok {
fmt.Printf("An API error has returned: %s", err)
return
}
if err != nil {
panic(err)
}
// Output string in json format.
fmt.Printf("%s", response.ToJsonString())
}
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://www.tencentcloud.com/document/product/1278/85305?from_cn_redirect=1.
// The key can be obtained at the official console https://console.tencentcloud.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);
}
);
package com.tencent;
import com.tencentcloudapi.common.AbstractModel;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.tcb.v20180608.TcbClient;
import com.tencentcloudapi.tcb.v20180608.models.*;
public class Sample
{
public static void main(String [] args) {
try{
// 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://www.tencentcloud.com/document/product/1278/85305?from_cn_redirect=1.
// The key can be obtained at the official console https://console.tencentcloud.com/cam/capi.
Credential cred = new Credential("", "");
// Instantiate an HTTP option, optional, which can be skipped if there is no special requirement.
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("tcb.tencentcloudapi.com");
// Instantiate a client option, optional, which can be skipped if there is no special requirement.
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// Instantiate the client object to request the product, and clientProfile is optional.
TcbClient client = new TcbClient(cred, "", clientProfile);
// Instantiate a request object. Each interface will correspond to a request object.
EditAuthConfigRequest req = new EditAuthConfigRequest();
// The returned resp is an instance of EditAuthConfigResponse, corresponding to the request object.
EditAuthConfigResponse resp = client.EditAuthConfig(req);
// Output string in json format.
System.out.println(AbstractModel.toJsonString(resp));
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
}
}
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백