Skip to content

Maybe it's time to change hybridauth to the new version? #3492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
net1313 opened this issue Oct 6, 2018 · 17 comments · Fixed by #4099
Closed

Maybe it's time to change hybridauth to the new version? #3492

net1313 opened this issue Oct 6, 2018 · 17 comments · Fixed by #4099
Labels
type: enhancement An improvement or new feature request

Comments

@net1313
Copy link

net1313 commented Oct 6, 2018

3.0 instead of outdated?
More features and more providers. Fewer connectivity issues and more modern approach to authentication through social media.

@Moc Moc added the type: enhancement An improvement or new feature request label Oct 8, 2018
@Moc Moc added this to the e107 2.2.0 milestone Oct 11, 2018
@CaMer0n
Copy link
Member

CaMer0n commented Oct 15, 2018

Yes! @net1313 Are you okay to test all the e107 social logins for FB, Twitter etc.. and report back here?

@net1313
Copy link
Author

net1313 commented Oct 15, 2018

Yes! with great pleasure.

@CaMer0n
Copy link
Member

CaMer0n commented Oct 15, 2018

@net1313 Excellent! 👍 I'll commit the new hybridauth version to git so you can test it.

@CaMer0n
Copy link
Member

CaMer0n commented Oct 15, 2018

@net1313 v3 appears to be VERY different to v2 of HybridAuth. It could require a major rewrite of how e107 utilizes it (which I have no time to do). So, this is not a simple upgrade unfortunately. If you wish to try it yourself and send a pull-request once it is working, it would be very welcome! I don't want to risk breaking everyone's social logins by simply committing it at this moment.

The best I could do for now is to upgrade to the latest v2, since it is primarily a simple overwrite of the files/folders.

@net1313
Copy link
Author

net1313 commented Oct 15, 2018

Sorry, i didn't mention this before. I've already tested new hybridauth. i'm not totally sure (it was one month ago) but it seems that only one thing to change is one function in /handlers/e107_class.php (and then to add more options in social plugin)

@CaMer0n
Copy link
Member

CaMer0n commented Oct 15, 2018

Okay, that's good news. Would you be okay to make a fork of e107 and upgrade hybridAuth on your fork to the latest version? Then others here could also test it out. And once everything is confirmed working, a pull-request could be made.

@net1313
Copy link
Author

net1313 commented Oct 15, 2018

just give me one week. I'll test it locally.

@net1313
Copy link
Author

net1313 commented Oct 22, 2018

Here is what I tested during the last week.
Version 3.0.0. RC - apart from declaring namespaces, there are many changes to be made in many of e107 files. Does anybody want?

Version 2.12.0 I have not finished testing yet.

Version 2.11.0 succeffully checked. It works. It has a lot of new providers. I've tested with Facebook, Twitter, Github, Google, Yandex, Vkontake ...

The "additional providers" folder goes with version 2.11 of Hybridauth.
But it is not part of the "Providers" folder and you have to copy the file you need from "adittional providers" into "Hybrid/Providers" folder.
I propose to copy all providers files there.

So the 2.11.0 is OK and could be integrated in without changing e107_class and other files of the system except only one file in Social plugin.
But at this stage integration would not be done automatically.

In e107_plugins/social/admin_config file in:

$this->social_logins = array (
.....
"New Provider" => array (
					"enabled" => true,
					"keys"    => array ( "id" => "", "secret" => "" )
				),

This way may be added a new provider.

In order to prevent inexperienced users from modifying Social plugin files manually it would be better to implement in Social plugin admin_config.php a new function which checks all available providers.
Something like this

getFilename()
....
$filename = end(explode(".", $file));
.....

Then the user can select only those that he needs.

But there is another small issue. e107_core/shortcodes/batch/signup_shortcodes

$button = (defset('FONTAWESOME') === 4) ? ......$tp->toGlyph('fa-'....

There are no glyph icons of new providers in "old" Font Awesome versions. And instead of "fa fa-" we must write fab. Even if the version matches, and in case when you want to display buttons, not glyphs, then src='".e_IMAGE_ABS."xup/{$p}.png' does not display the provider's button.
You need to add your prefered social button to the directory e107_images/xup but to force the button displaying we need change (defset('FONTAWESOME') === 4) to something else.

@CaMer0n
Copy link
Member

CaMer0n commented Oct 23, 2018

Thank you @net1313 ! I agree for the configurations. Like you said - I believe we should add all configurations and then display the ones that are detected in the file system.

@Moc Moc removed this from the e107 2.2.0 milestone Jan 31, 2019
@LaocheXe
Copy link
Member

@net1313 should we work on v3.0 for e107? FONTAWESOME should have most, if not all of the providers on that list, and the one's missing we could get and add to the xup images folder. I can work on the social plugin, and add the additional providers.

@Moc
Copy link
Member

Moc commented Mar 23, 2019

Fontawesome has been updated in core as well, so that's not an issue. Integrating a newer version of hybridauth will be the challenge.

@LaocheXe
Copy link
Member

LaocheXe commented Mar 23, 2019

I Checked Fontawesome site, searched for Blizzard, and Steem (came up with nothing) - yes the real challenge would be that.

Sadly their documentation to migrate from 2 to 3 hasn't been started yet: https://hybridauth.github.io/developer-ref-migrating.html

@net1313
Copy link
Author

net1313 commented Mar 23, 2019

@LaocheXe thanks for invitation. I can't promise to begin immediately. So after this summer it will be probably possibly.

@net1313
Copy link
Author

net1313 commented Mar 28, 2019

Google+ is dead, but if you want to keep social plugin update and allow users login/register through Google account (eg. gmail) just replace a file Google.php in Providers directory of Hybridauth by this file
(https://github.com/hybridauth/hybridauth/blob/e7fb724aea4822b48e6d484e58ac8e541b205086/hybridauth/Hybrid/Providers/Google.php)
was successfully tested and works.

@CaMer0n
Copy link
Member

CaMer0n commented Feb 18, 2020

@net1313 I was just wondering if you would like to test the pull-request of @Deltik with some social media logins? It is a full upgrade of HybridAuth as you requested. :-)

@net1313
Copy link
Author

net1313 commented Feb 18, 2020

@CaMer0n Thanks. I'll try during this month

@CaMer0n
Copy link
Member

CaMer0n commented Feb 20, 2020

@net1313 Cheers! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement An improvement or new feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants