JavaScript
Twitter login
13 min
twitter login introduction this section explains how you can integrate twitter login into your javascript project after completing this step by step guide, you will be ready to upload your code to cloud code this project will use the newly released version 3 1 parse server on your project dashboard, go to server settings > manage parse server(settings) and select 3 1 1 for more information on migrating to parse server 3 1 x, see this guide see this guide if you do not understand the syntax of the cloud code for this project prerequisites to begin with this tutorial, you will need an app created at back4app see the create new app tutorial to learn how to create an app at back4app set up a subdomain for your back4app app see activating your web hosting and live query to learn how to create an subdomain in back4app a twitter account and you must apply for developer access 1 create a new back4app app first of all, it’s necessary to make sure that you have an existing app created at back4app however, if you are a new user, you can check this tutorial https //www back4app com/docs/get started/new parse app to learn how to create one 2 generate access tokens in order for you to get the twitter login working in your project, you must have the consumer key and consumer secret to generate your access tokens keys, you must have a twitter app basically, you have two options if you have existing twitter apps and you would like to edit them, please access the twitter app dashboard if you want to create a new app, you can access the same dashboard, but you must have an approved developer account hint while you are requesting access for a developer account, you will certainly be asked to answer some questions, but don’t forget to agree with the terms of the contract 2 1 configure the app details in this topic, we’re going to configure the twitter app credentials note that it’s necessary to activate webhosting to this application and to read more about webhosting look at back4app webhosting tutorial after that go to twitter dashboard and choose to create an app create an app or you can edit an existing app going to details details > edit edit > edit details edit details fill up the app name application description tell us how this app will be used for the website url you can leave it as your back4app subdomain https //www back4app com/docs/platform/parse web hosting and the callback urls will be the subdomain https //www back4app com/docs/platform/parse web hosting + /twitter callback /twitter callback it will looks something like this 3 twitter set up to start using the twitter login for javascript, you need to follow these steps to link back4app with your twitter app and log in to your back4app account; click on server settings server settings of your app then, click on settings settings of the twitter login block it should look like this 4 get the template download the template at our github repository you can do that using the following command line 5 replace keys after downloading the project above, please open the /cloud/app js /cloud/app js file and replace the following variables with the keys generated in step 2 6 upload your code to back4app server to deploy your app with back4app, you need to upload your code to cloud code in order to do that, follow the steps below go to your app at back4app website and click on server settings server settings find the “cloud code” block and click on settings settings the ''cloud code'' block looks like this 3\ click on choose files choose files and select all the files imported by index html index html move them to public public , then click save save , as shown here 4\ your files will look like this 7 it’s done after following the guide described above, you just need to open your browser with the web hosting address that you have created in case you need any help or a function/link doesn’t work, please contact our team via chat!