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 theid
andaccess_token
provided by the client. - Secure Authentication: When
enableInsecureAuth
is disabled, the adapter exchanges thecode
andredirect_uri
for an access token using Weibo's OAuth API. enableInsecureAuth
is deprecated and may be removed in future versions. Use secure authentication withcode
andredirect_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"
}
};