[MODULE] HybridAuth

(Markvanrossum) #1

This is a forum page for the module Hybridauth (http://www.yiiframework.com/extension/hybridauth/) for social logins.

I’ve just put up the first release. Comments/thoughts etc let me know!



(Scottv) #2

Nice looking module. I am trying it out. Is there a way to display the authentication for Yahoo or others in a pop-up versus to a new page? I see Facebook option for pop-up. I also see other providers for AOL, Windows Live and such can you give some doc as to configuration settings?


(Idrini) #3


(Idrini) #4

btw, why is openid not working? and the rest of the 28 provider… maybe put in a note about them:p

(Yii) #5

Will try it out and I’m rooting for you to continue work on this extension. :)

(Jacob Moen) #6

Okay, this is great - but why the heck are you not contributing to the already existing HybridAuth module??

If you wasn’t aware of it, I can understand that you released this, but could you please consider joining Sampa?

His extension is called YiiAuth.

(Jjhayesiii) #7

I agree we should not have multiple modules for this, but was under the impression that markvr was more-or-less taking over development from Sampa - but it would be nice if it were clear that yiiauth was being deprecated, and hybridauth was now the "official" extension for it…even better if it were a public repository (which, to me, should be standard for yii extensions to help reduce the fragmentation)…

(Jacob Moen) #8

Even-even better would be if Yiiauth was maintained by both Sampa and Markvr and hosted on Bitbucket or Github. :)

Not trying to rain on any parade, but … I’ve said what I wanted to say.

Besides: Yiiauth is a cooler name.

(Yii) #9

+1 for hosting this on GitHub.

(Amber Au) #10

I installed this after trying to lightly customise yii-auth and encountering a lot of messy problems. This one was working the way I wanted in an hour or two. It’s a much cleaner release. I’ve also customised this to only request a username/email if it can’t retrieve an email from the provider. Worked with yii-user no problems. I’ve done fairly extensive testing with Yahoo, Google, Facebook, Twitter & Linked In and it all seems to be working.

(Markvanrossum) #11

Because, and apologies to Sampa here, YiAuth is a mess. I started out using it as a base and rapidly realised it would be better to implement hybrid-auth from scratch again by extending CBaseUserIdentity, which seemed a more correct way to do it. YiiAuth requires you to extend ALL your controllers from it’s class for example…rather than extending this Yii class.

And I called it “hybrid-auth” mainly because I’m lazy and unorignal (!) but also so it’s clearer what it does. The name YiiAuth isn’t overly clear what it does.

I’ll continue developing this, I need to add OpenID support (I’ve been away for a week and just got back).

(Idrini) #12

tbh using yii-user with yiiauth took me less then 5 min when I helped a user who pm:ed me.

And extending the new useridentity class is not easier then extending one controller from the yiiauth componen.t. even if its a bad solution just fix that instead? because markvr, changing what class ONE controller extends from isnt that bad… Same as rights do (one of the most popular extensions for yii). And I use rights in all my projects so I thought it wouldnt be that big of a deal.

What bothers me is you complain about extending one’s main controller from a yiiauth component instead of the base CController beeing awfull, when you expect people to do the exact same thing but wtih a useridentity, something people are alot less used to do. And you somehow lost the most basic easy to use login form and have to do a special fix for that? o_O

I wish you luck but this just seems like you do this for prestige since it is not good for anything else.

(the end product quality for the yii community).

Oh well:) glhf

(Markvanrossum) #13

Hey I don’t want to get into a spat over this, I’m sorry if I caused offence. I was simply explaining why I didn’t continue to develop YiiAuth and instead started from scratch. For my purposes I needed something that could drop into the standard Yii skeleton app, to provide social auth alongside the default login controllers with the minimal modifications to existing apps. YiiAuth extends other classes that don’t come with the default app OR the module - the class I was missing is called “Model” - and I had no idea what that did or where it came from.

When I looked at the code I decided it would be cleaner to reimplement it, and then thought I would release what I’d done.

I’m new to Yii (which is awesome BTW!) and I haven’t studied any other extensions so maybe having all controllers extend from your classes is common, but to me it seemed to reduce the ability to “drop in” authentication methods with minimal changes the the rest of the app, which is what I wanted to do. I also don’t understand how having all the controllers extend a modules class would scale to more than one module. You’d end up extending totally different unrelated classes on each other, with possible method/property name conflicts etc.

(Markvanrossum) #14

Updated to support OpenID and use the Yii asset framework to handle icons.

(Markvanrossum) #15

Updated to enable you to retrive the Hybrid_Auth adapter:

$adapter = Yii::app()->getModule('hybridauth')->getAdapter();

Use this to post status updates etc.

See the Hybrid Auth docs for more info - http://hybridauth.sourceforge.net/apidoc.html

(Jacob Moen) #16

Since I raised the issue in the first place, let me clarify: I think it’s OK that you go ahead and create your own HybridAuth extension.

If that works for you, then it’s great. :)

There are several extensions which uses a common controller base - Rights is one of them (widely used) - and your approach is just as valid.

Time will tell which version is the strongest.

The ultimate ‘solution’ would of course be to fix YiiAuth so that it can support the two approaches.

That shouldn’t be too hard, as common functionality could be extracted into a shared base.

But I digress.

The survival of an extension also depends on how well the extension is maintained…

Even though I am disappointed, I am fine with you deciding to go for your own extension.

(Idrini) #17

Im sorry, I have been in a shitty mode apparently and my choice of words was bad.

I’m glad your back and updating this.

Perhaps jacmoe and I should help you instead.

I who has made the yiiauth extension and understand it could extract the usefull parts,

example would be the ability to have more then one provider connected to the same account.

(not that takes along time:p) but with a seperate table instead of modifying the user table fits the "just add it" mentality to, since you only have to run an sql command instead of modifying your table and model.


I just realised:

An installer function could fix alot. adding a $install property, then checking if its true then create the neccessary tables and check requierements (if user model exists etc…) to prevent errors popping up all over the place (which normally happends with more complex modules.

(Markvanrossum) #18

How does that work if more than one extension/module does this?

As I put above:


(Markvanrossum) #19

Possibly, although I wonder if Yii migrations would be more suitable. I haven’t looked at them much so I’m not sure yet.

(Jacob Moen) #20

Good question. :)

Perhaps a behavior?

Could either be controller behavior or model behavior. Or perhaps even both?

That would probably be the best way to do it.

And ensure that it will coexist with other extensions.

And to comment on another thing: +1 for migrations. :)