Skip to content

Commit

Permalink
Merge pull request #226 from yuklia/master
Browse files Browse the repository at this point in the history
 Add multi Auth integration #206
  • Loading branch information
Anton authored and Anton committed May 14, 2015
2 parents b49e9a9 + d0b34db commit f3241ea
Show file tree
Hide file tree
Showing 30 changed files with 736 additions and 2,551 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ nbproject
composer.lock
composer.phar
/vendor/*
phpunit.xml
12 changes: 0 additions & 12 deletions application/configs/default/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,5 @@
"encryptFunction" => function ($password, $salt) {
return md5(md5($password) . $salt);
}
),
"facebook" => array(
"appId" => "%%appId%%",
"secret" => "%%secret%%",
),
"twitter" => array(
"consumer_key" => "%%consumerKey%%",
"consumer_secret" => "%%consumerSecret%%"
),
"google" => array(
'client_id' => "%%client_id%%",
'client_secret' => '%%client_secret%%'
)
);
49 changes: 49 additions & 0 deletions application/configs/default/hybridauth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* Created by PhpStorm.
* User: yuklia
* Date: 05.05.15
* Time: 14:04
*/

/**
* @link http://hybridauth.sourceforge.net/userguide/Configuration.html
*/
return array(
//"base_url" the url that point to HybridAuth Endpoint (where index.php and config.php are found)
"base_url" => "%%domain%%/auth/endpoint",

"providers" => array(
// google
"Google" => array( // 'id' is your google client id
"enabled" => true,
"wrapper" => array( "path" => "Providers/Google.php", "class" => "Hybrid_Providers_Google" ),
"keys" => array("id" => "%%client_id%%",
"secret" => "%%client_secret%%"),
"scope" => "https://www.googleapis.com/auth/userinfo.profile ". // optional
"https://www.googleapis.com/auth/userinfo.email" , // optional
"access_type" => "offline", // optional
"approval_prompt" => "force", // optional
),

// facebook
"Facebook" => array( // 'id' is your facebook application id
"enabled" => true,
"wrapper" => array( "path" => "Providers/Facebook.php", "class" => "Hybrid_Providers_Facebook" ),
"keys" => array("id" => "%%appId%%", "secret" => "%%secret%%"),
"scope" => "email, user_about_me, user_birthday, user_hometown, publish_actions", // optional
),

// twitter
"Twitter" => array( // 'key' is your twitter application consumer key
"enabled" => true,
"wrapper" => array( "path" => "Providers/Twitter.php", "class" => "Hybrid_Providers_Twitter" ),
"keys" => array("key" => "%%consumerKey%%", "secret" => "%%consumerSecret%%")
)
),

"debug_mode" => false,

// to enable logging, set 'debug_mode' to true, then provide here a path of a writable file
"debug_file" =>''
);
111 changes: 0 additions & 111 deletions application/library/Google/Client.php

This file was deleted.

127 changes: 0 additions & 127 deletions application/library/Twitter/Client.php

This file was deleted.

44 changes: 44 additions & 0 deletions application/models/Auth/AuthInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Created by PhpStorm.
* User: yuklia
* Date: 06.05.15
* Time: 18:41
*/
namespace Application\Auth;

/**
* Interface AuthInterface
* @package Application\Auth
*/
interface AuthInterface
{
/**
* @param array $data
* @param \Application\Users\Row $user
* @return void
*/
public function registration($data, $user);

/**
* @return void
*/
public function authProcess();

/**
* @return array
* @throws \Application\Exception
*/
public function getOptions();

/**
* @param \Application\Auth\Row $auth
* @return mixed
*/
public function alreadyRegisteredLogic($auth);

/**
* @return array
*/
public function getProfile();
}

0 comments on commit f3241ea

Please sign in to comment.