new OAuth2Adapter(options)
Parse Server Configuration
To configure Parse Server for OAuth2 Token Introspection, use the following structure:
{
"auth": {
"oauth2Provider": {
"tokenIntrospectionEndpointUrl": "https://provider.com/introspect",
"useridField": "sub",
"appidField": "aud",
"appIds": ["my-app-id"],
"authorizationHeader": "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
"oauth2": true
}
}
}
The adapter requires the following authData
fields:
id
: The user ID provided by the client.access_token
: The access token provided by the client.
Auth Payload
Example Auth Payload
{
"oauth2": {
"id": "user-id",
"access_token": "access-token"
}
}
Notes
tokenIntrospectionEndpointUrl
is mandatory and should point to a valid OAuth2 provider's introspection endpoint.- If
appidField
is defined,appIds
must also be specified to validate the app ID in the introspection response. authorizationHeader
can be used to authenticate requests to the token introspection endpoint.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The adapter configuration options. Properties
|