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

This action usually should be called right after the provider login page redirect.

You could also check the OAuth2 web integration example.

API details
POST
/api/collections/collectionIdOrName/auth-with-oauth2
Path parameters
Param Type Description
collectionIdOrName String ID or name of the auth collection.
Body Parameters
Param Type Description
Required provider
String The name of the OAuth2 client provider (e.g. "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.

Body parameters could be sent as JSON or multipart/form-data.
Query parameters
Param Type Description
Responses
{#each responses as response (response.code)} {/each}
{#each responses as response (response.code)}
{/each}