Skip to content

Social Settings

Backendless provides support for logging in users with Facebook or Twitter credentials. Once logged in, Backendless creates a registered user in its internal user storage and links the Backendless user account with his external social account (see the "socialAccount" column in the Users table on the Data screen). To enable social login, a Backendless backend must be configured with API keys.

Login with Twitter Setup

This configuration is available on the Manage > App Settings screen of the Backendless Console: social-settings-twitter.zoom50

To obtain your Twitter Consumer key and secret:

  1. In a browser, navigate to and sign in with your Twitter account.
  2. Click "Create New App":
  3. Enter application name and description.
  4. For the Website field use the following value:

  5. For the Callback URLs field use the values shown below, where YOUR-APP-ID and REST-API-KEY are the values assigned to your Backendless app.

  6. Once the application is created, click the Keys and tokens tab and copy Twitter API key and secret values to the corresponding fields in Backendless console. You can find these fields when you login to your app in Backendless Console, click the Manage icon and scroll down to the Social Settings section. The fields  are Twitter Consumer key and Twitter Consumer secret fields:

  7. This completes the configuration setup. The Backendless backend is now ready to handle Twitter authentication. The steps below demonstrate how Login with Twitter can be tested:
  8. Run the following command in a terminal window (if you do not have access to the curl command, a similar request can be created using any REST plugin for Google Chrome). The request performs the Twitter login operation. Once the login is successful, user's account will also be created in the Backendless internal storage. This is the same request which Backendless SDK sends when using the loginWithTwitter method. Notice the "fieldsMapping" parameter - it specified how Twitter user properties will be mapped to Backendless user properties. In this example, Twitter's "userId" property will be presented as "twitterUserIdInBackendless" in the Backendless system. Similarly, Twitter's "screenName" will be saved as "'twitterUserIdInBackendless".Also, make sure to replace YOUR_APP_ID and REST_API_KEY with the specific values for your Backendless backend.
    curl -H Content-Type:application/json -X POST -d'{"fieldsMapping":{"userId":"twitterUserIdInBackendless", "screenName":"twitterScreenNameInBackendless"}, "redirect":true}' -v
  9. Once you run the command, look for the Location header in the response.
  10. Copy the value of the header and paste it into a web browser and authorize the app. This is the same thing that happens when you use Backendless SDK. The implementation opens a page which requests the user to authorize access:
Login with Facebook Setup

This configuration is available on the Manage > App Settings screen of the Backendless Console: social-settings-facebook.zoom50

To obtain your Facebook App ID/API Key and App Secret:

  1. Open
  2. Select an application or create one using the "My Apps" dropdown in the upper right corner.
  3. Make sure the application is public and available to all users as indicated by the green dot next to the application name:
  4. Locate the App ID and App Secret in the Settings section and copy the values into the corresponding fields in the Backendless Console (Manage > App Settings > Social Settings).
  5. IMPORTANT: For the Backendless' "Easy Facebook Login" option make sure to make the following changes:
  6. Click Settings on your Facebook application page.
  7. Enter into the App Domains field.
  8. Make sure the Contact Email field contains a valid email address.
  9. If the Website platform is not added, click + Add Platform and select Website.
  10. Enter as the Site URL.
    After you make the changes described above, the Settings section should look as shown below:
  11. Click Save Changes.
  12. Click the Advanced tab on the Settings section.
  13. Scroll down to the Client OAth Settings block and enter into the Valid OAth redirect URIs field
  14. Scroll to the bottom of the page and click Save Changes.