Skip to content
InfinityKnow

InfinityKnow

Infinity Knowledge (IK) : Technology, Articles, Topics, Facts or many More.

  • Home
  • Education
    • yttags
    • Make Money
    • Jobs
    • Programming
      • Technology
      • Web Design
      • WEB HOSTING
      • Interview
  • Entertainment
    • pakainfo
    • Sports
    • Tips and Tricks
      • Law
      • Photography
      • Travel
  • Health
    • Insurance
    • Lifestyle
      • Clothing
      • Fashion
      • Food
  • News
    • Insurance
      • Auto Car Insurance
      • Business Insurance
    • Donate
    • California
  • News
    • Political
  • Home Improvement
  • Trading
    • Marketing
    • Top Tranding
    • Business
    • Real Estate
  • Full Form
  • Contact Us
  • Google Adsense high CPC paying keywords
    Google Adsense high CPC paying keywords Make Money
  • how to install PHP Accelerator in Xampp
    how to install PHP Accelerator in Xampp Technology
  • PHP Laravel Get Public path Example
    PHP Laravel Get Public path Example Technology
  • Responsive Prestashop Themes
    Best Responsive Prestashop Themes Free and Premium Technology
  • Tips For Beginner Day Trader In Cryptocurrencies Articles
  • WooCommerce Change or Remove Single Product Page Description Title PHP
  • Angularjs Multiple images slider items - carousel multiple
    Angularjs Multiple images slider items – carousel multiple Technology
  • cloud storage
    cloud storage computing with example cloud
Login with Facebook and Twitter

OAuth Login with Facebook and Twitter using PHP

Posted on August 13, 2018August 13, 2018 By admin No Comments on OAuth Login with Facebook and Twitter using PHP

Today, We want to share with you OAuth Login with Facebook and Twitter using PHP.
In this post we will show you Login with Facebook using PHP, hear for we will give you demo and example for implement.In this post, we will learn about OAuth Login for Facebook Twitter and Google Plus Using PHP with an example.

Login with Facebook and Twitter using PHP

There are the Following The simple About OAuth Login with Facebook and Twitter using PHP Full Information With Example and source code.

Steps 1 : Download HybridAuth PHP library

Steps 1: first of all We have simple used redymate library such as a HybridAuth Library with this step by step fully working example, Therefor you simple here need all the source code download HybridAuth PHP library from here all source code on Github.

Steps 2 : Create Facebook and Twitter developer Account

Now, Steps 2: You some legaly should to retrive main social Developer main API(OAuth – authentication) Key as well as get Secret from your Developer accounts created and get all config data in Facebook and Twitter for Login with Facebook and Twitter using PHP.

READ :  Angular ng-app directive Example

Steps 3 :config for Twitter with Facebook

Steps3: And then you should to make simple changes config.php as well as put here below source code to this file.

[php]
$config =array(
“base_url” => “https://infinityknow.com/demo/login-with-facebook-twitter-php/hybridauth/index.php”,
“sources” => array (
“Facebook” => array (
“enabled” => true,
“keys” => array ( “id” => “Inf454nityPak574infops5SSkd”, “secret” => “Inf454nityPak574infops5SSkd” ),
),
“Twitter” => array (
“enabled” => true,
“keys” => array ( “key” => “Inf454nityPak574infops5SSkd”, “secret” => “Inf454nityPak574infops5SSkd” )
),
),
“debug_mode” => false,
“debug_file” => “”,
);
[/php]

Auto Post Tweets on Twitter via API Using PHP

Steps 4 : Facebook and Twitter Login(index.php)

Steps 4: and then make a simple main root file name index.php as well as put the below source code.

[php]

[/php]

Steps 5 : Login with Facebook and Twitter

Steps 5: Now, You will should to make new login.php as well put The below source code.

READ :  Vuejs Custom Filters Dependent MultiSelect

[php]
authenticate($source);
$scoial_profile = $authProvider->getUserProfile();
if($scoial_profile && isset($scoial_profile->identifier)) {
echo “Your Name :”.$scoial_profile->displayName.”
“;
echo “Img URL :”.$scoial_profile->profileURL.”
“;
echo “Your Image :”.$scoial_profile->photoURL.”
“;
echo “Logout“;
}
}
catch( Exception $e ) {
switch( $e->getCode() ) {
case 0 : echo “Unspecified some stuck error.”; break;
case 1 : echo “Hybridauth libs configuration error.”; break;
case 2 : echo “Provider not good configured.”; break;
case 3 : echo “Unknown or disabled source.”; break;
case 4 : echo “Missing source any devloper application credentials.”; break;
case 5 : echo “Authentication failed. ”
. “The clients has canceled the web authentication or the source refused the main connection.”;
break;
case 6 : echo “clients your request failed. Most likely the clients is not connected ”
. “to the source and he should to authenticate again.”;
$twitter->logout();
break;
case 7 : echo “clients not connected to the source.”;
$twitter->logout();
break;
case 8 : echo “Provider does not proviedes this feature.”; break;
}
echo “

READ :  Trigger button click on enter key JavaScript

Original error message: ” . $e->getMessage();
echo “


Trace

" . $e->getTraceAsString() . "

“;
}
}
?>
[/php]

Step 6 : Logout with Facebook and Twitter

Steps 6:Last step to make file name logout.php with the below some source code to handle your all the pages not access with logout functionality.

[php]

[/php]

Read :

  • Technology
  • Google Adsense
  • Articles

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Login with Facebook and Twitter.
I would like to have feedback on my Infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Related posts:

  1. Vuejs Facebook Login using PHP – vue facebook-login
  2. Vuejs Simple Navigation Menu vue router-link params
  3. Auto Post Tweets on Twitter via API Using PHP
  4. Vuejs Simple Tooltip Plugin v-tooltip Example
Technology, PHP Tags:Facebook, facebook developer, FacebookAPI, Login, SDK, Twitter, Twitter developer

Post navigation

Previous Post: JavaScript Display Random Image website
Next Post: PHP MySQLi Star Rating System using Ajax Jquery

Related Posts

  • php cURL Tutorial Send HTTP Requests Example
    php cURL Tutorial Send HTTP Requests Example Technology
  • Get url parameter using angular js
    Get url parameter using angular js Technology
  • Vuejs Computed Properties - Vue Watch Completed property
    Vuejs Computed Properties – Vue Watch Completed property Technology
  • Angular 4 Beginners Tutorial - Hello World in Angular 4
    Angular 4 Beginners Tutorial – Hello World in Angular 4 Technology
  • PHP Laravel Get Public path Example
    PHP Laravel Get Public path Example Technology
  • Angularjs Dynamically Add Class Remove Class with Toggle Class
    Angularjs Dynamically Add Class Remove Class with Toggle Class Technology

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Account web hosting (1)
  • AngularJs (277)
  • Articles (143)
  • Asp.Net (49)
  • Astrology (2)
  • Attorney (7)
  • Auto Car Insurance (4)
  • Biography (2)
  • Business (9)
  • Business Insurance (3)
  • California (4)
  • Choose the web hosting (1)
  • Clothing (6)
  • cloud (8)
  • Cloud data storage (2)
  • Credit (1)
  • Dedicated hosting server web (1)
  • Dedicated server web hosting (1)
  • Dedicated web hosting (1)
  • Degree (11)
  • Design (9)
  • Differences shared hosting (1)
  • Donate (2)
  • Education (37)
  • Energy web hosting (1)
  • Entertainment (6)
  • Facts (12)
  • Fashion (3)
  • Finance (3)
  • Food (5)
  • full form (90)
  • Google Adsense (22)
  • Health (20)
  • Home Improvement (5)
  • Insurance (6)
  • Interview (2)
  • Jobs (6)
  • jquery (2)
  • jQuery (2)
  • Laravel (164)
  • Lawyer (4)
  • Lifestyle (6)
  • Loans (6)
  • Make Money (31)
  • Managed dedicated server (1)
  • Managed hosting solution (1)
  • Managed servers (1)
  • Marketing (8)
  • Mortgage (2)
  • Movies (21)
  • MySQL (180)
  • News (5)
  • Photography (1)
  • PHP (250)
  • Programming (18)
  • Quotes (75)
  • Real Estate (2)
  • SEO (9)
  • Shared web hosting (1)
  • Shayari (67)
  • Sports (5)
  • Status (34)
  • Stories (45)
  • suvichar (8)
  • Tech (3)
  • Technology (675)
  • Tips and Tricks (42)
  • Top Tranding (35)
  • Trading (28)
  • Travel (12)
  • Uncategorized (8)
  • VueJs (179)
  • Web Design (2)
  • WEB HOSTING (1)
  • Web hosting company (1)
  • Web hosting really (1)
  • Web hosting windows (1)
  • Which website hosting (1)
  • Wishes (13)
  • wordpress (15)

Categories

AngularJs (277) Articles (143) Asp.Net (49) Attorney (7) Business (9) Clothing (6) cloud (8) Degree (11) Design (9) Education (37) Entertainment (6) Facts (12) Food (5) full form (90) Google Adsense (22) Health (20) Home Improvement (5) Insurance (6) Jobs (6) Laravel (164) Lifestyle (6) Loans (6) Make Money (31) Marketing (8) Movies (21) MySQL (180) News (5) PHP (250) Programming (18) Quotes (75) SEO (9) Shayari (67) Sports (5) Status (34) Stories (45) suvichar (8) Technology (675) Tips and Tricks (42) Top Tranding (35) Trading (28) Travel (12) Uncategorized (8) VueJs (179) Wishes (13) wordpress (15)
  • All Hindi & English Bloggers List with Full Detail [10+ Blog] Trading
  • Sar Pass
    Trekking across the natural beauties of Sar Pass Travel
  • Earrings of Varying Sorts
    Earrings of Varying Sorts Articles
  • VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs
    VueJs dynamic table rows – Add and Delete Rows dynamically using VueJs Technology
  • C# Armstrong Number Tutorial with Examples Technology
  • Vue js Loading Progress Bar Example - vue-progressbar
    Vue js Loading Progress Bar Example – vue-progressbar Technology
  • How to Open URL in New Tab using Vue JS
    How to Open URL in New Tab using Vue JS VueJs
  • How can we clean the wooden doors of kitchen cabinets ? Business

Copyright © 2022 InfinityKnow.

Powered by PressBook News WordPress theme