Login Authentication Plugin
Tencent CloudBase Framework Auth Plugin
CloudBase Framework Login Configuration Plugin: Through the CloudBase Framework, set up login configuration in the environment with one click.
Features
- Supports unauthenticated access, anonymous login, and login settings
- Will support configuration for Open Platform, Official Account, username/password, and other login methods
Usage
Step 1. Preparations
Specific steps please refer to Preparing the Cloud Development Environment and CloudBase CLI Command Tool
Step 2. Write cloudbaserc.json configuration
Add login plugin configuration in framework.plugins
.
{
"envId": "YOU_ENV_ID",
"framework": {
"plugins": {
"auth": {
"use": "@cloudbase/framework-plugin-auth",
"inputs": {
"configs": [
{
"platform": "NONLOGIN",
"status": "ENABLE"
}
]
}
}
}
}
}
Please refer to the configuration document below for specific configuration information.
Step 3. One-Click Deployment
cloudbase framework deploy
Configuration
By default, only appid
and privateKeyPath
need to be configured for use. The following configuration parameters are for scenarios with specific requirements.
Configuration Example
The Cloud Development configuration file cloudbaserc.json
allows modifying and writing plugin configurations in the plugins section.
{
"envId": "YOU_ENV_ID",
"framework": {
"plugins": {
"client": {
"use": "@cloudbase/framework-plugin-auth",
"inputs": {
"configs": [
{
"platform": "NONLOGIN",
"status": "ENABLE"
}
]
}
}
}
}
}
Configuration Parameters Description
configs
Required. The type is an array format: Array.<Login Object>
Login Object
Property Name | Type | Length | Required | Description |
---|---|---|---|---|
platform | String | 1-32 | Required | Platform name, enumerable values:<br>WECHAT-OPEN: WeChat Open Platform;<br>WECHAT-PUBLIC: WeChat Public Platform;<br>QQ-MINI: QQ Mini Program;<br>CUSTOM: Custom Login;<br>ANONYMOUS: Anonymous Login;<br>EMAIL: Email Login;<br>NONLOGIN: Non-login<br>Currently only ANONYMOUS and NONLOGIN are supported |
status | String | 1-32 | No | Enabled by default, enumerable values: ENABLE; DISABLE. |
platformId | String | 1-64 | Optional | AppID of the third-party platform |
platformSecret | String | 1-64 | Optional | AppSecret of the third-party platform |
More Plugins
Please visit the CloudBase Framework Plugin List to use other plugins in combination
Documentation Resources
- CloudBase Authentication Documentation: https://docs.cloudbase.net/authentication-v2/auth/introduce
- CloudBase official website: https://tcb.cloud.tencent.com/
- CloudBase Console: https://console.cloud.tencent.com/tcb