[MODULE] Yiiauth

sorry scrap that, I’m doing it a different way entirely :)

Ahh, to bad, I’ve been looking for someone to tidy it up, I’m well aware that its not the best.

I helped a guy to use this with Yii-user-management and I realised yes its kinda messy.

But hybridauth is the by far the easiest and most powerfull way to interact with social providers so someone had to atleast start this:p

Do/borrow/ anything you want.

Requiring the controllers to inherit from yiauth is bad, and requiring hybridauth at the root of the website (i.e. outside protected) isn’t ideal either.

Also you extend from Model, which is custom to you, or at least I couldn’t find it anywhere!

I’m doing it as a module where


class RemoteUserIdentity extends CBaseUserIdentity

and then RemoteUserIdentity::Authenticate does all the heavy lifting using hybridauth. This makes it essentially a drop in replacement/addition for the forms based auth. The bit that breaks encapsulation is the hybridauth callback that needs to be routed back into RemoteUserIdentity using a controller but there’s no way round that really.

It will probably be done in a week or so and I’ll post it up.

Yeah the extend from Model was a thing I missed to remove, and I choose to extend it from yiiauth so the updateStatus methods etc would be availeble easily everywhere.

The root thing… I tried to find out how to put it somewhere else but I found no answer. I agree on it beeing dumb.

A new UserIdentity class is not ideal either though, since you will still have to extend from it if you use a custom one already.

That’s really messy and unscalable, there are better ways of making it available using Yii’s excellent autoloading.

In the UserIdentity:


require dirname(__FILE__) . '/../Hybrid/Auth.php';

		

		$hybridauth = new Hybrid_Auth($this->_getConfig());

and then in the callback (this is the messy bit):


public function actionCallback() {

		require dirname(__FILE__) . '/../Hybrid/Auth.php';

		require dirname(__FILE__) . '/../Hybrid/Endpoint.php';

		Hybrid_Endpoint::process();

	}



Thanks a lot guys, great to see this getting some traction! Looking forward to markvr’s solution, as I’ve run into the same problems, but really had no idea where to go from there…

same as you…

I can’t try it.

anybody help us

I’ve put my first stab at a module to cleanly implement HybridAuth up at http://www.yiiframework.com/extension/hybridauth/

I’m away for almost 2 weeks now so haven’t had time to test it properly (I hate it when people say that as well, sorry), but it’s probably enough to be getting on with for now.

edit Ignore, it’s a fresh install and I haven’t setup the User class yet.”

You must have a user database table,and a user model class. Else it’s impossible to know if the user have logged in before:p

My opinion on this is that you shouldn’t have done that.

I don’t think Sampa would mind that you joined the Yiiauth team and contributed to it.

Personally, I’d rather see one great and well maintained auth module than a whole host of spin-offs.

Of course, Sampa (and I, when I get the time to join Yiiauth) can merge your changes back into Yiiauth, but I think this module needs more cooks in the kitchen. :)

Yeah, if the goal is to get the best possible module we should all work together. Unless it’s prestige that counts.

I have a shitload of stuff currently and currently I cannot realise the ideas I have.

One thing I think would be great is a basic complete user handling, i left my controller/model there as reference but I think beside optimising the performance/ease the installation that would be the next step in features.

Imho it would be great if one could just add yiiauth to the skeleton app and get it working. and from there modify to your personal needs. After that I would love to see a guide for integrating it with Yum and yii-user since those two modules are widely used…

OK, this fragmentation/duplication of effort is counter-productive. I personally don’t like the implementation as a module, so was hoping to see a simple extension or component wrapping HybridAuth from markvr. Even using a custom controller to manage the routes, with HybridAuth as an extension would be better.

For now, I am using Yiiauth since I want a single user to be able to use multiple providers as Yiiauth allows, but markvr’s implementation does not.

Thanks for your efforts, both of you, but can we get some consolidation?

I wouldnt mind that, Jacmoe has offered to help when he has time. I needed hybridauth for one of my projects and did the best I could :P Yiiauth is on github and the more improvements the better.

But I dont know have the skills or time to do it myself currently.

check your PHP version, it should be 5.3+ (preferably 5.3.2+)

Great module for openID authentication. I wondered if there is possible to make this module work with GoogleAPIs. I tried implementing googleapis extention, but got messed up on redirectUris. Maybe you know another great way to implement GoogleAPIs?

I didn’t understand this step:

You have to extend application.components.controller to Yiiauth

<?php class Controller extends Yiiauth{…?>

Where should I extend? What file?

I didn’t understand this step:

You have to extend application.components.controller to Yiiauth

<?php class Controller extends Yiiauth{…?>

Where should I extend? What file?

Guys where do I Put this code… should it be in main controller whos view uses the loginwidget.


You have to extend application.components.controller to Yiiauth

<?php class Controller extends Yiiauth{...?>



I am getting this error and i guess it is because of this

Hi

I am New to Yii Framework. i am not able to maintain session, after redirection from facebook, twitter. when, i already logged in with my form feilds. please help me. i am using Yiiauth(downloaded from github).

Hi All,

I have a problem here with the extension.

I am able to login using the Facebook and also am able to fetch the details from the facebook and store it to my DB .But i am not able to login using the other providers or get data from other providers. After adding other provider I cannot get data from facebook even. Desperatley need help on this.

I am using the my own code to store user data.

Also i want to know what is the difference between Yiiauth and Hybridauth extensions.

Are they the same , can i club these if needed.