Starting with version 2.7, PHP Melody comes with social login integration for both Twitter and Facebook.
In this tutorial we’ve set out to cover the Twitter integration. We’ll take you through the steps required to create a new app in Twitter and integrate this into PHP Melody.
The ultimate goal being to allow your visitors to register and log in using only their Twitter account.
Step 1: Creating a new Twitter App
Log into your Twitter account and then go to https://apps.twitter.com/
Click on the ‘Create a new app’ button and fill in the provided form. Very easy and straightforward.
Under the ‘Callback URL‘ you need to enter:
https://www.your-PHPMELODY-site.com/login.php
Your application should look like this: https://imgur.com/a/tm3Pj6K
Step 2: Get your API Key and API Secret
Once successfully created, your new Twitter App will come with a Consumer Key (API Key) and a Consumer Secret (API Secret).
Go to your Twitter App from https://apps.twitter.com/ and select the “Keys and Tokens” tab.
Copy the API Key and Secret into a text file.
If you have trouble locating the keys, here’s where they are:
Step 3: Add your Twitter API Key and API Secret into PHP Melody
Log into your PHP Melody website’s back-end and go to Settings > User tab.
Enter your keys in the Twitter Login form which is found under the User tab.
Only thing left to do is Enable the Twitter Login, hit ‘Save Changes‘ and you’re ready to accept Twitter users.
If you’d also like to integrate Facebook Login into your PHP Melody website, check out this tutorial.