我想将TikTok API与oAuth机制结合使用。
启动oAuth机制的控制器是这样的:
logger.info('Handle request from Tiktok Auth')
const csrfState = Math.random().toString(36).substring(2)
res.cookie('csrfState', csrfState, { maxAge: 60000 })
let url = 'https://open-api.tiktok.com/platform/oauth/connect/'
url += `?client_key=${process.env.TIKTOK_CLIENT_KEY}`
url += '&scope=user.info.basic,video.list'
url += '&response_type=code'
url += '&redirect_uri=https://www.helloworld.com/tiktok/callback/'
url += `&state=${csrfState}`
res.redirect(url)我的回调代码就这样被剪断了:
const config = {
method: 'post',
url: 'https://open-api.tiktok.com/oauth/access_token/',
params: {
client_key: process.env.TIKTOK_CLIENT_KEY,
client_secret: process.env.FACEBOOK_CLIENT_SECRET,
grant_type: 'authorization_code',
code,
},
headers: {},
}
return axios(config)但是,作为回应,我收到了这样的答复:200:
{
"data": {
"captcha": "",
"desc_url": "",
"description": "",
"error_code": 10013
},
"message": "error"
}我研究了TikTok API的状态代码,但是找不到任何东西。"10013“错误代码是什么意思?我为什么要犯这个错误?我怎么才能解决这个问题?请帮帮忙!
发布于 2022-08-11 11:46:01
您可以在这里找到TikTok错误代码。
https://developers.tiktok.com/doc/getting-started-android-handling-errors/
错误10013:客户端密钥或客户端秘密错误.
https://stackoverflow.com/questions/71170429
复制相似问题