I'm actually using this js function for the facebook connect.
window.fbAsyncInit = function(){
FB.init({
appId: '371***********',
status: true,
cookie: true,
xfbml: true ,
oauth:true,
channelUrl: '<?php echo base_url(); ?>fb-channel-file.php' //this domain
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById("fb-root").appendChild(e);
}());
// FB LOGIN -->
function FBlogin(){
FB.getLoginStatus(function(r){
FB.login(function(response) {
if(response.authResponse) {
$.ajax({
type:'GET',
url: _config_base_url+'/auth/ajax_login',
dataType:'json',
data:{'fb_at':response.authResponse.accessToken},
beforeSend:function(){
notify('Loading ...',false,'notify-info');
},
error:function(_response){
notify('An error occurred, please try again later.',false);
},
success:function(json){
notify_destroy();
window.location.href= _config_base_url+'/profile';
}
});
} else {}
},{scope:'email'/*,user_birthday,user_location*/});
});
}
Now i would like to reproduce the same/quite the same, function for allowing people to connect via Twitter
, i just turned that for Google+
,
but i really can't understand how to turn it up for the Twitter oAuth.
Any idea?