I'm trying to login to Snapchat from my app using their Login Kit.
This code (i changed the clientId):
onSnapChat() {
const state = `c25hcGNoYXR0ZXN0`;
const redirectUri = `https://us-central1-library.cloudfunctions.net/redirectSnapchat`;
const clientId = `45fad898-162e-48e0-8e4e-135adbc42716`;
const scopeList = ['https://auth.snapchat.com/oauth2/api/user.display_name'];
const scope = scopeList.join(' ');
const loginQS = {
client_id: clientId,
redirect_uri: redirectUri,
response_type: 'code',
scope: scope,
state: state
};
const stringifyLoginQS = qs.stringify(loginQS);
const SNAP_ACCOUNTS_LOGIN_URL = 'https://accounts.snapchat.com/accounts/oauth2/auth';
window.open(SNAP_ACCOUNTS_LOGIN_URL + '?' + stringifyLoginQS, '_blank');
}
Which returns this error: {"error":"invalid_request","error_description":"Missing PKCE parameters."}
Notes: 1. the redirect_uri matches the redirect uri whitelisted with Snapchat 2. i'm using the development environment OAUTH2 CLIENT ID 3. the redirect uri is to a Firebase cloud function. it never gets hit.
Any suggestions?
Thank you, r