new SpotifyAdapter(options)
Parse Server Configuration
To configure Parse Server for Spotify authentication, use the following structure:
Secure Configuration
{
"auth": {
"spotify": {
"clientId": "your-client-id"
}
}
}
Insecure Configuration (Not Recommended)
{
"auth": {
"spotify": {
"enableInsecureAuth": true
}
}
}
The adapter requires the following authData
fields:
- Secure Authentication:
code
,redirect_uri
, andcode_verifier
. - Insecure Authentication (Not Recommended):
id
,access_token
.
Auth Payloads
Secure Authentication Payload
{
"spotify": {
"code": "abc123def456ghi789",
"redirect_uri": "https://example.com/callback",
"code_verifier": "secure-code-verifier"
}
}
Insecure Authentication Payload (Not Recommended)
{
"spotify": {
"id": "1234567",
"access_token": "abc123def456ghi789"
}
}
Notes
enableInsecureAuth
is not recommended and bypasses secure flows by validating the user ID and access token directly. This method is not suitable for production environments and may be removed in future versions.- Secure authentication exchanges the
code
provided by the client for an access token using Spotify's OAuth API. This method ensures greater security and is the recommended approach.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The adapter configuration options. Properties
|