我可以获得OAuth2令牌,但无法撤消它。
再现错误:
let token_url = "https://api.twitter.com/oauth2/token";
let revoke_url = "https://api.twitter.com/oauth2/invalidate_token"
let auth = {
username: CLIENT_API_KEY,
password: CLIENT_API_SECRET_KEY
}
axios.post(token_url, "grant_type=client_credentials", { auth })
.then( response => {
let access_token = response.data["access_token"]
axios.post(revoke_url, `access_token=${access_token}`, { auth })
.then( response => {
console.log("REVOKE SUCCESS")
console.log(response)
})
.catch( e=> {
console.log("Failed to revoke")
console.log(e.response.data)
})
})
然后我得到
Failed to revoke
{ errors:
[ { code: 348,
message:
'Client application is not permitted to to invalidate this token.' } ] }
尝试使用谷歌搜索,但代码348和消息中没有任何内容。 http错误代码为401 (unauthorized)
。
我将永远无法撤销我的OAuth2令牌。帮助。