Skip to main content

Login Authentication Plugin

Tencent CloudBase Framework MP Plugin

Tencent CloudBase Framework Auth Plugin

Github License Npm version issue PRs Welcome star star

CloudBase Framework Login Configuration Plugin: Set up login configurations for your current environment with one click via the CloudBase Framework framework.

Features

  • Support unauthenticated and anonymous login settings
  • Will support configuration for Open Platform, Official Account, username/password, and other login methods

Usage

Step 1: Preparation

Specific steps can be found in Preparing the Cloud Development Environment and CloudBase CLI Command Tool

Step 2: Write the cloudbaserc.json configuration

Add the login plugin configuration in framework.plugins

{
"envId": "YOU_ENV_ID",
"framework": {
"plugins": {
"auth": {
"use": "@cloudbase/framework-plugin-auth",
"inputs": {
"configs": [
{
"platform": "NONLOGIN",
"status": "ENABLE"
}
]
}
}
}
}
}

For specific configuration details, please refer to the configuration documentation below

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 special requirements.

Configuration Example

The cloud development configuration file cloudbaserc.json allows modifying and writing plugin configurations in the plugins section of the configuration file.

{
"envId": "YOU_ENV_ID",
"framework": {
"plugins": {
"client": {
"use": "@cloudbase/framework-plugin-auth",
"inputs": {
"configs": [
{
"platform": "NONLOGIN",
"status": "ENABLE"
}
]
}
}
}
}
}

Configuration Parameters Instructions

configs

Required. The data type is an array format Array.<Login object>

Login Object

Property NameTypeLengthRequiredDescription
platformString1-32YesPlatform name. Enumerated values:<br>WECHAT-OPEN: WeChat Open Platform;<br>WECHAT-PUBLIC: WeChat Official Account 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
statusString1-32NoEnabled by default. Valid values: ENABLE, DISABLE.
platformIdString1-64NoAppID of the third-party platform
platformSecretString1-64NoAppSecret of the third-party platform

More Plugins

Please visit the CloudBase Framework plugin list to use other plugins in combination

Documentation Materials