Overview

Social Login API.

Introduction

When building an app with Appery.io, you can use social networks to authenticate users. This can be handy: if your app requires registration, instead of providing new credentials, the user can log in with a social network. For now, the following OAuth providers are supported:

  • Twitter
  • Facebook
  • Google

First, you should create your app on the OAuth provider side.

When your app is created, use the provided credentials to configure the connection under database settings: go to Database > Your database > Social connections, turn the toggle on for the needed social network, and specify the needed credentials.

When a user logs in via a social network, a new user will be created in Users collection of the Appery.io Database. Appery.io X-Appery-Session-Token will be returned for further API calls.

📘

Invoking Social Network API.

Returned token doesn’t allows to trigger social network providers API. It’s only valid for Appery.io API calls, for example, the database REST API. In other words, you won't be able to invoke a Facebook API to get a list of your friends. In order to do this, you will need to setup a standard Facebook login functionality.

Method Summary

Social network login API has the following methods:

MethodDescription
getTokenReturns Appery.io database token.
getUserIdReturns Appery.io database user id.
getStatusReturns current authentication status.
setDefaultDBSets default database id.
createUserCreates user in Appery.io database.
loginReceives Appery.io database token.
logoutInvalidates token in Appery.io database.
findUsersReturns list of users in Appery.io database.
isLoggedChecks if Appery.io database token is valid.
updateUserUpdates Appery.io database user.
invalidateDeletes Appery.io database token. Doesn’t invalidates token in Appery.io database.
logoutOauthRemoves social id from Appery.io database.
loginTwitterLogging in via Twitter.
loginFBLogging in via Facebook.
loginGoogleLogging in via Google.