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

Parameter

Description

provider_id

One of the supported OAuth providers: twitter, facebook, google.

token

Request token obtained.

verifier

The access code obtained from the provider after successful authentication. For example: code.

app_id

Provider’s application id (client id, consumer key, etc.)

timeout

Session 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>]