(repost from https://groups.google.com/forum/?hl=en&fromgroups=#!topic/hybridauth/CWo2R9suYts)
Starting with Facebook, I'm trying to use the provider Javascript SDKs to login and have HybridAuth "know" about it. Any help would be appreciated.
I started by including the configuration IDs in the data I pass to the View so I can use them when calling Javascript login functions. So in the middle of the GetProviders function of the Hybrid_Auth class, I added:
if(array_key_exists('keys', $params) && array_key_exists('id', $params['keys']))
$idps[$idpid]['id'] = $params['keys']['id'];
My Javascript includes something like this:
FB.init({
appId:'<?php echo $providers['Facebook']['id']; ?>',
cookie:true,
status : true,
xfbml:true
});
So far so good.
But after logging in (i.e., FB.login()) of course HybridAuth doesn't know and doesn't have the user information.
Then to "force" it, I tried calling the ".../hauth/login/Facebook" method via Ajax:
$.ajax({
type: "POST",
url: ".../hauth/login/Facebook",
cache: false,
...
Unfortunately, it seems like a number of 'redirects' in HybridAuth make this not work. I even added "data: {ajax:true}," to the Ajax call and tried to modify HyrbidAuth to not redirect if it $_POST['ajax'] existed. That didn't seem to do it either. (I even removed the "die();" at the end of the redirect() function to no avail.)
I'm thinking I'm either on the right track or I need to add a new HybridAuth method to detect and store data for all or specific connections that already exist.
Any ideas?
Thanks.