Integrating Appery Authentication with Bit6

Appery Backened Services provide great support for user management. With Bit6 you can easily enable voice and video calling as well as rich media messaging between your users, while delegating the user authentication to Appery.

Prerequisites

  1. Create an app in the Appery Platform

  2. Build your web or mobile app that authenticates users with the Appery Services

  3. Get Bit6 API Key and Secret for your app from Bit6 Dashboard

Users Service

Here is a short guide on creating users in Appery DB

Server Code

Import Services to the App

App Integration

  1. Initialize Bit6 SDK with your API key

  2. Follow the Appery documentation to authenticate the user

  3. Execute bit6_auth service to generate the Bit6 "external token"

  4. Provide this token as an argument to bit6.session.external(token) method

  5. Your Appery user is now authenitcated with Bit6 and can be reached by his Appery userId, username, email or other identities specified in the cloud function

Code Samples

JavaScript

//Example how a handler of Login success handler can look
var userID = data._id;
var username = Apperyio("username_input").val();

var params = {
    userID: userID,
    username: username
};
var onSuccess = function(d){
    var token = d.token;
    if (token) {
          b6.session.external(token, function(err) {
               //Bit6 login done
               Apperyio.navigateTo('mainScreen', {});
          });
     }
};

bit6_auth.execute({ data: params, success: onSuccess});