Closed KiritoXD01 closed 2 years ago
I have the same problem, I haven't found any solution
@trbsi I found a solution in Laravel, but basically I did the whole process from scratch, creating the token and PKCE keys and sending them to a snapchat URL
@KiritoXD01 How did you solve it?
` $state = Str::random(40); $codeVerifier = Str::random(128);
session()->put([
"state" => Str::random(40),
"code_verifier" => $codeVerifier
]);
$codeChallenge = strtr(rtrim(base64_encode(hash('sha256', $codeVerifier, true)), '='), '+/', '-_');
$query = http_build_query([
'client_id' => config('services.snapchat.client_id'),
'redirect_uri' => config('services.snapchat.redirect'),
'response_type' => 'code',
'scope' => 'https://auth.snapchat.com/oauth2/api/user.display_name https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar',
'state' => $state,
'code_challenge' => $codeChallenge,
'code_challenge_method' => 'S256',
]);
return redirect("https://accounts.snapchat.com/accounts/oauth2/auth?$query");
`
This is Laravel/PHP but you can translate the process to other languages, basically you create a random 128 characters long string as a code verifier and a 40 character long state string, them you base64 encode the code verifier with the format codeChallenge = strtr(rtrim(base64_encode(hash('sha256', $codeVerifier, true)), '='), '+/', '-_');
, create the query string with the info I sent and then redirect to snapchat's url
Socialite plugin for Snapchat is working fine. The problem why people get that stupid "Missing PKCE Parameters " error is because you need to do some extra steps:
Take your client ID and client secret from:
Add your accounts as Demo Users
Add correct redirect urls
That's it, it should work fine.
@trbsi correct, sorry I forgot to mention that part
I have the same error 'Missing PKCE Parameters" in core PHP even follow @KiritoXD01 instruction. how can I fix it?
I have the same error 'Missing PKCE Parameters" in core PHP even follow @KiritoXD01 instruction. how can I fix it?
Did you try https://github.com/SocialiteProviders/Providers/issues/792#issuecomment-1064411856
Closing due to inactivity.
Hi, I'm having an issue with the Snapchat integration, right now its showing Missing PKCE parameters.
I found a previous issue here not there was no resolution for it.
Everything is correct both in snapchat dev portal and Socialite