Closed nexxai closed 7 months ago
Just for posterity's sake:
Created PR here: https://github.com/SocialiteProviders/Providers/pull/1199
@nexxai does the provider by default request access to fields outside of the ones with the default scope? You should call ->scopes() when you use the redirect method to set custom scopes, as this PR changes the default for all users which will break anyone not approved for this scope
I will try using the ->scopes()
method and update this thread, but according to the docs, it says this scope should be required anyways.
Ok, I can confirm that using this worked:
return Socialite::driver('tiktok')
->scopes(['user.info.basic', 'user.info.profile'])
->redirect();
That said, I still think the default should be to include user.info.profile
since you can't technically use Socialite with its defaults for logging in to your Laravel app without it.
Hmm. Which field is included by default that triggers the error? ie required the profile scope? We can release a new major version to make sure we dont break existing.
I couldn't tell which specific field was triggering the error; the only error message I got was the one I posted in the OP of this thread and it gets truncated before it specifies the missing field.
At the end of the day, a new major version probably makes the most sense since it is definitely a breaking change, but also aligns the intent of the Socialite provider with the reality of what TikTok is providing, and also aligns with the documentation we already have in the repo.
Okay, looking at the docs, username
required that scope, which was broken by #1110
Fixed in #1183
There is no BC break now, add the scope if you want the username
Got a weird one here. I've set up the TikTok provider and have gone through the application process with TikTok. I've requested and been approved for the
user.info.basic
anduser.info.profile
scopes.The weirdness happens when I actually try to login with a TikTok account. I get sent to the correct oAuth approval screen and I correctly approve it, but when I get redirected to my app, my app throws a 500 Server Error.
The redirect URI I get sent back to is
https://MYAPP/auth/tiktok/callback?code=2-vF-hhkIvD34ZPoyBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAH81jiR34sCen7wwmI-995ebt9N22PbSZ2AMw5BLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHbkwvitP-IsmA_vELfgqBLAHBLAHtMfS89IETiVvcBLAHBLAHBLAHBLAHBLAHBLAHseH6PgqnJXjP8MdSyGN0PsCcw-stSV26%2A1%214608.va&scopes=user.info.basic&state=zYVWqwVR5GJBLAHBLAHBLAHBLAH
And it shows that the
scopes
value isuser.info.basic
, a scope I've been approved for, but if I checkstorage/logs/laravel.log
, I see this error:Does anyone have any insight as to why this might be happening?