Skip to content
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

[5.x] Add Twitter OAuth2 provider #574

Merged
merged 1 commit into from Jan 24, 2022
Merged

[5.x] Add Twitter OAuth2 provider #574

merged 1 commit into from Jan 24, 2022

Conversation

dehbka
Copy link
Contributor

@dehbka dehbka commented Jan 23, 2022

@driesvints driesvints changed the title Add Twitter OAuth2 provider [5.x] Add Twitter OAuth2 provider Jan 24, 2022
src/SocialiteManager.php Outdated Show resolved Hide resolved
src/SocialiteManager.php Outdated Show resolved Hide resolved
@taylorotwell taylorotwell marked this pull request as draft January 24, 2022 17:02
@taylorotwell
Copy link
Member

taylorotwell commented Jan 24, 2022

Converting to draft while Dries' requested changes are made. Please mark as ready for review when done.

@dehbka dehbka marked this pull request as ready for review January 24, 2022 18:24
@taylorotwell taylorotwell merged commit ea9288a into laravel:5.x Jan 24, 2022
@taylorotwell
Copy link
Member

@dehbka so, how would you actually use this? Socialite::driver('twitter-oauth-2')?

@dehbka
Copy link
Contributor Author

dehbka commented Jan 24, 2022

yeap

@dehbka so, how would you actually use this? Socialite::driver('twitter-oauth-2')?

@michaeldyrynda
Copy link
Contributor

michaeldyrynda commented Feb 4, 2022

@dehbka did you run into any issues with this?

Seems as though if you have a confidential client (web app or automated bot), you also need to send a basic auth header with the client ID and secret as username and password.

Not doing so results in authorisation failures when attempting to get a oauth token/fetching the authenticated user.

It does seem as though you can send the authorisation head for either public or confidential clients, so it may be sufficient to override the getAccessTokenResponse method on the TwitterProvider

Happy to send a PR for this, I spent longer than I care to admit trying to figure out why it wasn’t working 🥲

@ahmedsayedabdelsalam
Copy link

I know it's not related to laravel it might be permission or something, but i have little question if anyone can help
I was using 'twitter' driver for oauth1 and switched to 'twitter-oauth-2' but the user email now returns 'null'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants