We have created many open login systems like Facebook, Google,Â twitter, Microsoft and LinkedinÂ etc and now we are going to give you an article on login with Instagram, Instagram is anÂ online photo-sharing application which beautify your memories in pictures.
Here in this article we have used below files:
-config.php // Used for credentials
-index.php // Main file show login data
-instagram.class.php // Class file call data from instagram server
-instagram-login.pngÂ // Login button image
You have to register you app on Instagram
Contains key, secret and callback url
You can get yourÂ YOUR_APP_KEY andÂ YOUR_APP_SECRET by Registering app on Instagram.
Now come to the main file index.php
This file contains user information method and shows buttons.
$instagram = new Instagram(array(
'apiKey' => YOUR_APP_KEY,
'apiSecret' => YOUR_APP_SECRET,
'apiCallback' => YOUR_APP_CALLBACK
$code = $_GET['code'];
if (true === isset($code))
$data = $instagram->getOAuthToken($code);
$loginUrl = $instagram->getLoginUrl();
echo "<a class=\"button\" href=\"$loginUrl\">Sign in with Instagram</a>";
In this code we used 2 extra filesÂ instagram.class.php andÂ config.php
Created objectÂ $instagramÂ and call login url with this methodÂ $instagram->getLoginUrl()Â once you approve access of your profile we useÂ $data = $instagram->getOAuthToken($code) this method and pase $code to get user information.
So this is all you can download and test its demo also, comment your suggestions and problems which you faced in its implementation.