Log in through using twitter in my website


#1

give me the full details and step by step instruction how to use twitter login into my website


#2

https://dev.twitter.com/docs/auth/sign-twitter


#3

goodbye twitter


#4

hallow firendz , all over the world


#5

hi guys…


#6

function twitter_login()
{
twttr.anywhere(function (T) {
T.signIn();

		/*$j.ajax({
	type:"POST",
	url:'/users/login_via_twitter/',
	success:function (response) {

		}
	});*/

});

twttr.anywhere(function (T) {

	 T.bind("authComplete", function (e, user) {
  	$j.ajax({
	type:"POST",
	url:'/users/login_via_twitter/',
	success:function (response) {

		}
	});
});

});

}

function login_via_twitter() {
//readQuery
$path=explode(’?’,rawurldecode($_POST[‘path’]));
$url=$path[0];
$getParament=$path[1];
$token="";
$token_secret="";
if($_POST[‘token’]){
$token=$_POST[‘token’];
}
if($_POST[‘token_secret’]){
$token_secret=$_POST[‘toke_secret’];
}
//postParament
//collectStuff
$consumer_secret="…";
$consumer_key="…";
$timestamp=time();
$signature_method=“HMAC-SHA1”;
if($_POST[‘signature_method’]){
$signature_method=$POST[‘signature_method’];
}
$chart=“0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz”;
$nouce = substr( str_shuffle($chart),0,42);
$version = “1.0”;
//build baseString
$baseString = “${getParament}&oauth_consumer_key=${consumer_key}&oauth_nouce=${nouce}&oauth_signature_method=${signature_method}&oauth_timestamp=${timestamp}&oauth_token=${token}&oauth_version=${verson}”;
$baseString = rawurlencode($baseString);
$eurl = rawurlencode($url);
$baseString = “GET&${eurl}&${baseString}”;
//signature
$s_key = “${consumer_secret}&${token_secret}”;
$signature = base64_encode(hash_hmac(“sha1”,$baseString,$s_key));
//buildheadString
$h = array();
$h[Authorization]=“OAuth oauth_consumer_key=”${consumer_key}",oauth_nouce="${nouce}",oauth_signature="${signature}",oauth_signature_method="${signature_method}",oauth_timestamp="${timestamp}",oauth_token="${token}",oauth_version="${version}"";
//get&post
$url = sprintf("%s?%s",$url,$getParament);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_HTTPGET,true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_HTTPHEADER,$h);
$data = curl_exec($ch);
if ($data === false) {
header(‘HTTP/1.1 400 Bad Request’);
exit;
} else {
echo $data;
}
}


#7

thanks to ma reverb nation friends


#8

hi , I can’t get access key and access token secret using oauth library? help me pls


#9

http://webseosites.eu


#10

Meta seo http://webseosites.eu


#11

I need a sleep full night… atleast,for once.


#12