Sign In with a Social Network

Sign in with a social network.

To sign in the user with a social network, send a POST request:

https://api.appery.io/rest/1/db/oauth/login

Parameters Summary

ParameterDescription
provider_idOne of the supported OAuth providers: twitter, facebook, google.
tokenRequest token obtained.
verifierThe access code obtained from the provider after successful authentication. For example: code.
app_idProvider’s application id (client id, consumer key, etc.)
timeoutSession timeout (ms).

Returns a 201 with newly created user data or a 200 with a logged in user id and session token (if the user existed and was linked prior to this action).

If session_token is specified, authenticated user will be linked with provider’s user. Code 200 will be returned with the user id and session token.

Example

curl -X POST \
   -H "Content-Type: application/json" \
   -H "X-Appery-Database-Id: <database_id>" \
   [-H "X-Appery-Session-Token: <session_token>"] \
   -d '{"provider": <provider_id>, "token":<token>, "verifier":<verifier>, "appId":<app_id>}' \
   https://api.appery.io/rest/1/db/oauth/login[?timeout=<timeout>]