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
tokenIntrospectionEndpointUrlis mandatory and should point to a valid OAuth2 provider's introspection endpoint.- If
appidFieldis defined,appIdsmust also be specified to validate the app ID in the introspection response. authorizationHeadercan be used to authenticate requests to the token introspection endpoint.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | The adapter configuration options. Properties
|
