我正在尝试使用他们的登录工具包从我的应用程序登录到 Snapchat。
此代码(我更改了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');
}
返回此错误: {"error":"invalid_request","error_description":"Missing PKCE parameters."}
注意: 1.redirect_uri 与 Snapchat 中列入白名单的重定向 uri 匹配 2.我正在使用开发环境 OAUTH2 CLIENT ID 3.重定向 uri 指向 Firebase 云功能。它永远不会被击中。
有什么建议么?
谢谢你,r