WeiboAdapter

new WeiboAdapter(options)

Parse Server Configuration

To configure Parse Server for Weibo authentication, use the following structure:

Secure Configuration

{
  "auth": {
    "weibo": {
      "clientId": "your-client-id",
      "clientSecret": "your-client-secret"
    }
  }
}

Insecure Configuration (Not Recommended)

{
  "auth": {
    "weibo": {
      "enableInsecureAuth": true
    }
  }
}

The adapter requires the following authData fields:

  • Secure Authentication: code, redirect_uri.
  • Insecure Authentication (Not Recommended): id, access_token.

Auth Payloads

Secure Authentication Payload

{
  "weibo": {
    "code": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "redirect_uri": "https://example.com/callback"
  }
}

Insecure Authentication Payload (Not Recommended)

{
  "weibo": {
    "id": "1234567",
    "access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}

Notes

  • Insecure Authentication: When enableInsecureAuth is enabled, the adapter directly validates the id and access_token provided by the client.
  • Secure Authentication: When enableInsecureAuth is disabled, the adapter exchanges the code and redirect_uri for an access token using Weibo's OAuth API.
  • enableInsecureAuth is deprecated and may be removed in future versions. Use secure authentication with code and redirect_uri.
Parameters:
NameTypeDescription
optionsObject

The adapter configuration options.

Properties
NameTypeAttributesDefaultDescription
enableInsecureAuthboolean<optional>
false

[DEPRECATED] Enable insecure authentication (not recommended).

clientIdstring

Your Weibo client ID.

clientSecretstring

Your Weibo client secret.

Examples

Auth Data Example (Secure)

const authData = {
  weibo: {
    code: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    redirect_uri: "https://example.com/callback"
  }
};

Auth Data Example (Insecure - Not Recommended)

const authData = {
  weibo: {
    id: "1234567",
    access_token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
};