'modules'=>array( 'hybridauth' => array( 'baseUrl' => 'http://'. $_SERVER['SERVER_NAME'] . '/hybridauth', 'withYiiUser' => false, "providers" => array ( "openid" => array ( "enabled" => true ), "yahoo" => array ( "enabled" => true ), "google" => array ( "enabled" => true, "keys" => array ( "id" => "", "secret" => "" ), "scope" => "" ), "facebook" => array ( "enabled" => true, "keys" => array ( "id" => "", "secret" => "" ), // A comma-separated list of permissions you want to request from the user. See the Facebook docs for a full list of available permissions: http://developers.fa...pi/permissions. "scope" => "email", // The display context to show the authentication page. Options are: page, popup, iframe, touch and wap. Read the Facebook docs for more details: http://developers.fa...ialogs#display. Default: page "display" => "" ), "twitter" => array ( "enabled" => true, "keys" => array ( "key" => "", "secret" => "" ) ) ) ),
[MODULE] HybridAuth
#41
Posted 22 July 2012 - 05:33 PM
#42
Posted 23 July 2012 - 08:41 PM
The ability to link multiple providers to a single user was one of the strengths of the Yii-auth implementation. Sampa did a great job, but the approach was messy. If this extension has multiple providers per user, then it will meet my requirements.
#43
Posted 23 July 2012 - 08:44 PM
M Wotton, on 23 July 2012 - 08:41 PM, said:
The ability to link multiple providers to a single user was one of the strengths of the Yii-auth implementation. Sampa did a great job, but the approach was messy. If this extension has multiple providers per user, then it will meet my requirements.
You know, you can ignore that. I just refreshed the source page on github and see you have added a separate table - thus resolving the issue. Thanks.
#44
Posted 23 July 2012 - 10:10 PM
Thanks for the feature for Yii User. I now get another error:
PHP warning
include(HaLogins.php): failed to open stream: No such file or directory
/home/something/yii/framework/YiiBase.php(418)
406 {
407 foreach(self::$_includePaths as $path)
408 {
409 $classFile=$path.DIRECTORY_SEPARATOR.$className.'.php';
410 if(is_file($classFile))
411 {
412 include($classFile);
413 break;
414 }
415 }
416 }
417 else
418 include($className.'.php');
419 }
420 else // class name with namespace in PHP 5.3
421 {
422 $namespace=str_replace('\\','.',ltrim($className,'\\'));
423 if(($path=self::getPathOfAlias($namespace))!==false)
424 include($path.'.php');
425 else
426 return false;
427 }
428 return class_exists($className,false) || interface_exists($className,false);
429 }
430 return true;
Stack Trace
#0
+
/home/something/yii/framework/YiiBase.php(418): YiiBase::autoload()
#1
unknown(0): YiiBase::autoload("HaLogins")
#2
+
/home/something/yii/framework/db/ar/CActiveRecord.php(378): spl_autoload_call("HaLogins")
#3
+
/home/something/yii/framework/web/CActiveDataProvider.php(75): CActiveRecord::model("HaLogins")
#4
–
/home/something/protected/modules/hybridauth/models/HaLogin.php(104): CActiveDataProvider->__construct("HaLogins", array("criteria" => CDbCriteria))
099 $criteria->compare('loginProvider',$loginProvider,true);
100 $criteria->compare('loginProviderIdentifier',$loginProviderIdentity,true);
101
102 $login = new CActiveDataProvider('HaLogins', array(
103 'criteria'=>$criteria,
104 ));
105
106 if ($login->itemCount == 0) {
107 return null;
108 } else {
109 // TODO - Can't seem to get this to work with relations properly....
#5
–
/home/something/protected/modules/hybridauth/components/RemoteUserIdentity.php(43): HaLogin::getUser("Yahoo", "censored-url")
38 $adapter = $hybridauth->authenticate($this->loginProvider,$params);
39 if ($adapter->isUserConnected()) {
40 $this->_adapter = $adapter;
41 $this->loginProviderIdentifier = $this->_adapter->getUserProfile()->identifier;
42
43 $user = HaLogin::getUser($this->loginProvider, $this->loginProviderIdentifier);
44
45 if ($user == null) {
46 $this->errorCode = self::ERROR_USERNAME_INVALID;
47 } else {
48 $this->id = $user->id;
#6
–
/home/something/protected/modules/hybridauth/controllers/DefaultController.php(44): RemoteUserIdentity->authenticate()
39 }
40
41
42 $identity = new RemoteUserIdentity($_GET['provider']);
43
44 if ($identity->authenticate()) {
45 // They have authenticated AND we have a user record associated with that provider
46 if (Yii::app()->user->isGuest) {
47 $this->_loginUser($identity);
48 } else {
49 //they shouldn't get here because they are already logged in AND have a record for
If you need more informations, I will be happy to provide them.
Thanks again!
#45
Posted 24 July 2012 - 07:34 AM
markvr, on 22 July 2012 - 05:28 PM, said:
It needs improving and more testing before updating the Yii exentension but if anyone is desperate for these features now then it's a start.
YiiUser Support:
You must have either NO config entries for YiiUser AND HybridAuth:withYiiUser config entry == false, OR the opposite.
i.e. what you mustn't do is HybridAuth:withYiiUser==false and also some config entries (e.g. imports etc) for YiiUser or vice versa. It will screw the autoloading up.
Kudos for putting it up on Github!
#46
Posted 24 July 2012 - 10:40 AM
valleed, on 23 July 2012 - 10:10 PM, said:
HaLogin should be singular not plural, I wonder if the lines like
$login = new CActiveDataProvider('HaLogins', array(
'criteria'=>$criteria,
));
are wrong, but if so it wouldn't work at all, but it does work on my PC. Hmm, I might have some old detrius lying around that made it work on my PC but no one elses! This is why I haven't updated the Yii repo extension, what's on Github isn't properly tested yet.
I'll take a look and let you know.
cheers,
mark
#47
Posted 24 July 2012 - 11:24 AM
The only thing bugging me now is getting the error message from the provider instead of:
User profile request failed! Google returned an invalide response.
Also, I have remove the strings firstname and lastname from the DefaultController, but that's just me.
#48
Posted 24 July 2012 - 11:56 AM
valleed, on 24 July 2012 - 11:24 AM, said:
Yep, I had an old HaLogins model floating around which meant it worked on my PC. Fixed and updated Github
Quote
User profile request failed! Google returned an invalide response.
Don't know, I haven't tested with Google, there's only so many providers I can test with! Might be worth checking the HybridAuth docs on sourceforge.
Quote
Yeah that's a bit of a bodge but Yii User needs those entries filled in otherwise it bombs out when you view the profile. A better solution is going to be to fork the view that requests a username/email to include names as well if it's running in Yii User.
#49
Posted 31 July 2012 - 02:39 PM
See the extension for details.
#50
Posted 31 July 2012 - 06:58 PM
#51
Posted 31 July 2012 - 07:34 PM
Asterisk Pound, on 31 July 2012 - 06:58 PM, said:
This seemed to make the most sense to me...
protected.modules.hybridauth.components.RemoteUserIdentity line 41 (function authenticate)
$this->userData = $this->_adapter->getUserProfile();
#52
Posted 01 August 2012 - 03:21 AM
Asterisk Pound, on 31 July 2012 - 07:34 PM, said:
protected.modules.hybridauth.components.RemoteUserIdentity line 41 (function authenticate)
$this->userData = $this->_adapter->getUserProfile();
The problem with that was you really need to put it into the session to use it in your controllers, but when PHP unserialised the session (at session_start()), because it couldn't autoload the Hybrid_Auth classes, it threw an error and died.
Doing:
$ha = Yii::app()->getModule('hybridauth')->getHybridAuth();
means that Hybrid_Auth gets init'd correctly, and you can then get the adapter directly from there, without needing to worry about manually loading all the Hybrid_Auth classes yourself, before session_start();
#53
Posted 01 August 2012 - 04:43 AM
I'm now trying out your module, and it works fine, but might I suggest you use the Yii::app()->createAbsoluteUrl() method to create the URLs because not everyone uses the urlManager the same way, and things might go wrong.
#55
Posted 09 August 2012 - 04:58 AM
Secondly, anyone know why twitter might not be working? Facebook works absolutely fine but when I try to use twitter an error stops the app. The error doesn't clear until I wipe the cookies to clear the session.
The error contains the following in stack trace:
– /home/snowglo/public_html/protected/modules/hybridauth/Hybrid/Storage.php(25): unserialize("O:9:"Exception":7:{s:10:"*message";s:69:"Authentification fail...")And the top message is:
include(DefaultController.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory
DefaultController.php does exist so I can't explain why that's been reported, but the issue seems to be that twitter auth is failing and, despite double checking the public key and secret, I can't see why...
any ideas?
#56
Posted 11 August 2012 - 02:02 PM
subdee, on 01 August 2012 - 04:43 AM, said:
I'm now trying out your module, and it works fine, but might I suggest you use the Yii::app()->createAbsoluteUrl() method to create the URLs because not everyone uses the urlManager the same way, and things might go wrong.
+1 for using more flexible url creation, it is not possible to use this extension when locale is part of the url.
Also, it will be nice to add support of CSRF.
It is possible to validate CSRF throuth GET parameter (see this solution)
Also, it will be good compatibility improvement to rewrite db table defination according to Yii db convention http://www.yiiframew...ention#database and update appropriate model class.
Quote
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`login_provider` varchar(50) NOT NULL,
`login_provider_identifier` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `login_provider_2` (`login_provider`,`login_provider_identifier`),
KEY `login_provider` (`login_provider`),
KEY `login_provider_identifier` (`login_provider_identifier`),
KEY `user_id` (`user_id`),
KEY `id` (`id`)
) ENGINE=InnoDB
#57
Posted 14 August 2012 - 01:48 PM
Nice addon.
But i have question:
Why, when an user accept the terms of the social network's application, you will ask username & email in the next step?
Is more better to let choose a password and a display name.
The email can be get in social account. or im wrong?
#58
Posted 15 August 2012 - 02:14 PM
#59
Posted 19 August 2012 - 08:38 PM
I have an issue. I am a new Yii user. I followed all the steps of the presentation page but I have an issue. When I click on Twitter or Facebook it redirect me to:
****://localhost:8084/hybridauth/default/login/?provider=facebook
Then I am getting a 404 error.
My config is:
'hybridauth' => array(
'baseUrl' => '****://localhost:8084' . '/hybridauth',
"providers" => array (
"facebook" => array (
"enabled" => true,
"keys" => array ( "id" => "AA", "secret" => "BB" ),
"scope" => "email,publish_stream",
"display" => "Texte pour facebook"
),
"twitter" => array (
"enabled" => true,
"keys" => array ( "key" => "AA", "secret" => "BB" )
)
)
),
I used **** because I cannot post links
#60
Posted 20 August 2012 - 05:52 AM
What should I do to fix this?
charmi, on 19 August 2012 - 08:38 PM, said:
I have an issue. I am a new Yii user. I followed all the steps of the presentation page but I have an issue. When I click on Twitter or Facebook it redirect me to:
****://localhost:8084/hybridauth/default/login/?provider=facebook
Then I am getting a 404 error.
My config is:
'hybridauth' => array(
'baseUrl' => '****://localhost:8084' . '/hybridauth',
"providers" => array (
"facebook" => array (
"enabled" => true,
"keys" => array ( "id" => "AA", "secret" => "BB" ),
"scope" => "email,publish_stream",
"display" => "Texte pour facebook"
),
"twitter" => array (
"enabled" => true,
"keys" => array ( "key" => "AA", "secret" => "BB" )
)
)
),
I used **** because I cannot post links

Help













