e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

[Question] Twitch oauth integration #1674

Closed nesjett closed 4 years ago

nesjett commented 8 years ago

Well, I need to integrate twitch oauth and I think the best way is by using the hybrid auth twitch extension (cause youre already using it for other networks) but, I dont know how are you doing it with e107.

Can someone point me on the right direction, or an starting point? How does work the e107 logic to signup/login a user with oauth?

Thanks,

EDIT: Is not enought by adding the keys on the config area and adding the provider to handlers>hybrid>providers the file-> https://github.com/hybridauth/hybridauth/blob/master/additional-providers/hybridauth-twitchtv/Providers/TwitchTV.php

When I try to signup with twitch from the test page, I get a blank page, no redirection to the authorization page

Im getting the blank page at: system/xup/signup?provider=Twitch&back=aHR0cDovL2x----moreCode---b3V0ZT1zeXN0ZW0veHVwL3Rlc3Q%3D

nesjett commented 8 years ago

Update: Doing it the way you added Steam support doesnt work.

I updated my twitch classes name because seems that it must be "TwitchTV" for hybridauth, anyway, updating the name everywere only got me to an error, I´m not getting a blank page anymore but a "[2]Signup failed! Wrong provider."

LaocheXe commented 8 years ago

I believe it is a security issue with e107, if I recall @CaMer0n had to do something with a filter in the core to allow Steam login

nesjett commented 8 years ago

@LaocheXe @CaMer0n working a lot I found that error messages are not as fiable as I would like to. Manually debuggin (in my case with twitch) the line

$provider = new e_user_provider('TwitchTV');

Is not setting the _provider var (null), for some reason I dont understand right now.

About the Steam implementation, Im gettin an error, somethink about that wrong SQL command to signup the user, but Ive not looked into it for now.

LaocheXe commented 8 years ago

Um with Steam it doesn't provide a user email, so if you have that required then it might be an issue, not to sure.

nesjett commented 8 years ago

@LaocheXe I´ll check it, but twitter doesnt provide email neither and it works fine (except when It return a 401 hehe, @CaMer0n check this if you have a moment, its probably just a missed try/catch)

This is the error when I try to use the steam signup (anyway Ill have to test this on a clean site, not take me very seriously about Steam login at this point) steam_error

EDIT: @LaocheXe well, Ive just tested steam on a fresh install, same error...

CaMer0n commented 8 years ago

@nesjett If you want to send a pull-request with the appropriate try/catch sections added, please do. You can use e107::getMessage()->addError() to display the errors. See code areas in user_model.php and user_handler.php

Moc commented 6 years ago

@nesjett @LaocheXe I believe quite some changes have taken place with the Twitch oauth integration. Can this issue be closed or are there still open issues to be looked into?

LaocheXe commented 6 years ago

I will need to perform a test to make sure.

LaocheXe commented 6 years ago

Tested it, getting Error 22 Wrong Provider (TwitchTV Provider)

So just to check, I updated the Steam provider - get Fatal error: Class 'Hybridauth\Adapter\OpenID' not found in /usr/www/taskforce13tsw/defiantz/e107_handlers/hybridauth/Hybrid/Providers/Steam.php on line 31

capture-line-31

Looks like Hybird Auth updated their code, because | use Hybirdauth\Adapter\OpenID; and everything else under it is new to me.

Version is now HybirdAuth3 (guess e107 is using HybirdAuth2)

Moc commented 4 years ago

Seeing that #3492 (upgrading HybridAuth to the newer version) has been completed, Twitch Social login should work as well.

Closing this issue, but let us know if there are any issues after testing