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 https //www back4app com/docs/advanced guides/parse server 3 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 https //www back4app com/docs/get started/new parse app to learn how to create an app at back4app set up a subdomain for your back4app app see https //www back4app com/docs/platform/activating web hosting to learn how to create an subdomain in back4app a https //twitter com/ and you must apply for https //twitter com/i/flow/login?input flow data=%7b%22requested variant%22%3a%22eyjyzwrpcmvjdf9hznrlcl9sb2dpbii6imh0dhbzoi8vzgv2zwxvcgvylnr3axr0zxiuy29tl2vul3bvcnrhbc9wzxrpdglvbi9lc3nlbnrpywwvymfzawmtaw5mbyj9%22%7d 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 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 https //twitter com/i/flow/login?input flow data=%7b%22requested variant%22%3a%22eyjyzwrpcmvjdf9hznrlcl9sb2dpbii6imh0dhbzoi8vzgv2zwxvcgvylnr3axr0zxiuy29tl2vul2fwchmifq%3d%3d%22%7d 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 https //www back4app com/docs/platform/parse web hosting after that go to https //developer twitter com/en/apps 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 https //www back4app com/docs/platform/parse web hosting and the callback urls will be the 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 curl lok https //github com/templates back4app/twitter login js/archive/master zip && unzip master zip 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 const back4appwebhostdomain = ' your back4app webhost domain your back4app webhost domain '; const consumer key = ' your consumer key your consumer key '; const consumer secret = ' your consumer secret your consumer secret '; 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 https //www back4app com/ 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!