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
enableInsecureAuthis enabled, the adapter directly validates theidandaccess_tokenprovided by the client. - Secure Authentication: When
enableInsecureAuthis disabled, the adapter exchanges thecodeandredirect_urifor an access token using Weibo's OAuth API. enableInsecureAuthis deprecated and may be removed in future versions. Use secure authentication withcodeandredirect_uri.
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The adapter configuration options. Properties
|
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"
}
};