eloquent-oauth icon indicating copy to clipboard operation
eloquent-oauth copied to clipboard

Twitter Authentication - Different logic with email not provided

Open TomClarkson opened this issue 11 years ago • 6 comments

This package is excellent.

I notice that there is no Provider for twitter at the moment. Is this something that you would accept a pull request for?

The difficulty with the twitter API is they don't return the users email address so in your app you might not want to add $user->confirmed = false; into the call back and in the controller redirect the user to a complete sign up page where they verify their email and you would have an App::before filter to protect again unconfirmed users. Does this sound about right?

Thanks

TomClarkson avatar Apr 09 '14 23:04 TomClarkson

Hey Tom, yeah I would love to get a pull request for Twitter support. I know their API works a lot differently than standard OAuth2 providers (I believe the API is OAuth1 and they have some bastardized OAuth2-ish API just for authentication?) so it's definitely going to be a bit of a special case and a bit more work than the other providers.

In regards to the email thing, I think what I would do is just leave the email field in the UserDetails object as null, and leave it up to the person using the package to decide if they need the user's email, and then implement something in their app to deal with it separately. What you've suggested is definitely a valid way that someone could go about implementing it. I don't think this package needs to be concerned with solving that problem directly though, so I think just returning a null email address for Twitter auth and adding a note to the docs mentioning that Twitter doesn't give you an email address would be enough.

So yeah, cook up a pull request if you like, would love to get Twitter support going!

adamwathan avatar Apr 10 '14 01:04 adamwathan

Just an update, planning on adding a dependency on the Laravel Socialite package for the next version which will give us Twitter support right out of the box. Hopefully some time in the next few weeks.

adamwathan avatar Oct 03 '14 13:10 adamwathan

+1 Yes Laravel Socialite as dependency would be great

abhimanyu003 avatar Feb 20 '15 02:02 abhimanyu003

I'm working on an app in Laravel 5 and wanted to use Socialite but found this package much easier to use. Only thing missing is the Twitter auth, which would be great. Thanks for the work on this package!

degrovejazz avatar Mar 08 '15 19:03 degrovejazz

+1 This package is great, thanks so much. Can't wait for twitter support.

JonathanBruce avatar Mar 25 '15 19:03 JonathanBruce

cant wait for twiiter support

prio101 avatar Jan 17 '16 02:01 prio101