new GitHubAdapter(options, authData)
Parse Server Configuration
- To configure Parse Server for GitHub authentication, use the following structure:
{
"auth": {
"github": {
"clientId": "12345",
"clientSecret": "abcde"
}
}
The GitHub adapter exchanges the authData.code
provided by the client for an access token using GitHub's OAuth API. The following authData
field is required:
code
Insecure Authentication (Not Recommended)
Insecure authentication uses the authData.id
and authData.access_token
provided by the client. This flow is insecure, deprecated, and poses potential security risks. The following authData
fields are required:
id
([DEPRECATED]): The GitHub user ID.access_token
([DEPRECATED]): The GitHub access token. To configure Parse Server for insecure authentication, use the following structure:
{
"auth": {
"github": {
"enableInsecureAuth": true
}
}
Deprecation Notice
The enableInsecureAuth
option and insecure authData
fields (id
, access_token
) are deprecated and will be removed in future versions. Use secure authentication with clientId
and clientSecret
.
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The adapter configuration options. Properties
| ||||||||||||||||||||
authData | Object | The authentication data provided by the client. Properties
|
Secure Authentication Example
// Example authData for secure authentication:
const authData = {
github: {
code: "abc123def456ghi789"
}
};
Insecure Authentication Example (Not Recommended)
// Example authData for insecure authentication:
const authData = {
github: {
id: "1234567",
access_token: "abc123def456ghi789" // Deprecated.
}
};