This is a module of the Open Web Framework.
It is a ported project from the hybridauth.
You can find it at : https://github.com/hybridauth/hybridauth.
See https://github.com/binarysec/owfCore for OpenWF.
It requires the session module to work. See https://github.com/binarysec/owfSession.
It currently only support Facebook, Google and LinkedIn login. (07/09/2014)
[hybridauth]
Facebook_id = 523....
Facebook_secret = 35cb3....
Google_id = ...
Google_secret = ...
....
We will see later how to get credentials : https://github.com/binarysec/owfPpHybridAuth#how-to-get-credentials
/* get the main aggregator */
$hybrid = $this->wf->hybridauth();
/* configuration location */
$config = $hybrid->config;
/* get the javascript running login buttons */
$js = hybrid->get_javascript();
/* make a template and add this */
$tpl = new core_tpl($this->wf);
$tpl->set("hybridauth", array('tpl' => $js, 'config' => $config));
echo $tpl->fetch("myProject/login");
%{if isset($hybridauth['tpl'])}%
%{$hybridauth['tpl']}%
%{/if}%
<form><!-- my login form here --></form>
%{if isset($hybridauth['config']['providers']['Facebook'])}%
<div id="fb-root"></div>
<button type="button" class="btn btn-primary btn-sm" onclick="hybridauth.login.fb();">
<img src='https://fbstatic-a.akamaihd.net/rsrc.php/v2/yR/r/teE39sffXW8.png' alt='Facebook' />
%{@ "Login with Facebook"}%
</button>
%{/if}%
%{if isset($hybridauth['config']['providers']['Google'])}%
<button class="g-signin"
data-scope="https://www.googleapis.com/auth/plus.login"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-clientId="%{$hybridauth['config']['providers']['Google']['keys']['id']}%"
data-callback="onSignInCallback"
data-theme="dark"
data-cookiepolicy="single_host_origin"></button>
%{/if}%
%{if isset($hybridauth['config']['providers']['LinkedIn'])}%
<script type="IN/Login"></script>
%{/if}%
hybridauth.login.fb();
See http://hybridauth.sourceforge.net/userguide/IDProvider_info_Facebook.html
See first step of this link : https://developers.google.com/+/quickstart/javascript
Then don't forget to add APIs "Contacts API" and "Google+ API" in your project.
More help : http://hybridauth.sourceforge.net/userguide/IDProvider_info_Google.html
See http://hybridauth.sourceforge.net/userguide/IDProvider_info_LinkedIn.html