Auth with OAuth2 ({collection.name})

Authenticate with an OAuth2 provider and returns a new auth token and record data.

For more details please check the OAuth2 integration documentation .

API details
POST

/api/collections/{collection.name}/auth-with-oauth2

Body Parameters
Param Type Description
Required provider
String The name of the OAuth2 client provider (eg. "google").
Required code
String The authorization code returned from the initial request.
Required codeVerifier
String The code verifier sent with the initial request as part of the code_challenge.
Required redirectUrl
String The redirect url sent with the initial request.
Optional createData
Object

Optional data that will be used when creating the auth record on OAuth2 sign-up.

The created auth record must comply with the same requirements and validations in the regular create action.
The data can only be in json, aka. multipart/form-data and files upload currently are not supported during OAuth2 sign-ups.

Query parameters
Param Type Description
expand String Auto expand record relations. Ex.: Supports up to 6-levels depth nested relations expansion.
The expanded relations will be appended to the record under the expand property (eg. {`"expand": {"relField1": {...}, ...}`}).
Only the relations to which the request user has permissions to view will be expanded.
Responses
{#each responses as response (response.code)} {/each}
{#each responses as response (response.code)}
{/each}