Socket
Book a DemoInstallSign in
Socket

@cloudbase/framework-plugin-auth

Package Overview
Dependencies
Maintainers
15
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudbase/framework-plugin-auth

云开发 Tencent CloudBase Framework Auth Plugin 插件,可以一键设置项目下的登录配置。

latest
Source
npmnpm
Version
1.9.7
Version published
Maintainers
15
Created
Source

Tencent CloudBase Framework MP Plugin

Tencent CloudBase Framework Auth Plugin

Github License Npm version issue PRs Welcome star

云开发 CloudBase Framework 框架「登录配置」插件: 通过云开发 CloudBase Framework 框架一键设置环境下的登录配置。

功能特性

  • 支持未登录、匿名登录登录设置
  • 后续会支持开放平台、公众号、账号密码等其他登录方式配置

使用方法

步骤一. 准备工作

具体步骤请参照 准备云开发环境和 CloudBase CLI 命令工具

步骤二. 编写 cloudbaserc.json 配置

framework.plugins 中新增登录插件配置

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

具体配置信息请参考下面的配置文档

步骤三. 一键部署

cloudbase framework deploy

配置

默认情况下仅需要配置 appidprivateKeyPath 即可使用,以下配置参数针对有特殊需求的场景

配置示例

云开发的配置文件 cloudbaserc.json,可在配置文件的 plugins 里修改和写入插件配置

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

配置参数说明

configs

必填,类型为数组格式 Array.<Login 对象>

Login 对象

属性名称类型长度是否必填描述
platformString1-32平台名称,可枚举值:
WECHAT-OPEN:微信开放平台;
WECHAT-PUBLIC:微信公众平台;
QQ-MINI:QQ 小程序;
CUSTOM:自定义登录;
ANONYMOUS:匿名登录;
EMAIL:邮箱登录;
NONLOGIN:未登录
目前仅支持 ANONYMOUS 和 NONLOGIN
statusString1-32默认开启,可枚举值:ENABLE;DISABLE。
platformIdString1-64第三方平台的 AppID
platformSecretString1-64第三方平台的 AppSecret

更多插件

请访问 CloudBase Framework 插件列表 搭配使用其他插件

文档资料

FAQs

Package last updated on 03 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts