Twilio 可编程聊天 - 旧聊天的访问被拒绝(代码:54007)
我们在项目中使用 Twilio 可编程聊天已有一年。在移动端我们使用twilio-chat v.6.0.0 SDK。在后端,我们使用 java 库 - com.twilio.sdk:twilio:7.51.0
问题
但是几天前,我们开始在移动端遇到授权问题。当我们创建新的聊天并与他们合作时,一切都很好。
但是,当我们尝试获取旧聊天消息(在该问题之前创建)时,我们收到以下错误身份访问被禁止(状态:403,代码:54007)
我们尝试过的内容
- 我们尝试升级/降级移动 SDK 和后端库。
- 我已阅读
代码:54007 文档
。我们从未配置过任何同步服务,可能它们是引入的并且没有为旧聊天正确配置? - 我们只有一项最近(自动)创建的同步服务,并且启用 ACL 标志设置为false。
我的猜测是最近聊天 API 中的权限发生了一些变化,默认配置对我们不起作用。
我不知道具体是什么。请帮忙。
We are using Twilio Programmable Chat on our project for 1 year. On the mobile side we use twilio-chat v.6.0.0 SDK. On the backend side we use java library - com.twilio.sdk:twilio:7.51.0
Problem
But a couple of days ago we started experiencing problems with authorization on the mobile side. Everything is ok when we create new chats and work with them.
But when we try to fetch messages for the old chats (created before that problems), we receive the following error access forbidden for identity (status: 403, code: 54007)
What we tried
- We tried to upgrade/downgrade both mobile SDK and backend libraries.
- I've read the
code: 54007 documentation
. We have never configured any Sync services, possible they were introduced and not properly configured for the old chats? - We have only one Sync service that was created (automatically) recently and ACL enabled flag is set to false.
Here is the structure of our access token:
My guess is that something has recently been changed with the permissions in the Chat API and the default config is not working for us.
I don't know exactly what it could be. Please, help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我们的例子中,当我们尝试为用户不是
错误:身份访问被禁止(状态:403,代码:54007)成员的通道获取消息时,我们遇到了相同的错误。 Twilio SDK
twilio-chat
6.0.0 和 4.1.0 就发生过这种情况。在查看 Twilio 控制台中的“角色和权限”部分后,我们注意到与另一个子帐户相比,“服务用户”(聊天用户的默认用户角色)没有激活“editChannelAttributes”权限仍然可以为未加入的通道获取消息。
为服务用户激活权限“editChannelAttributes”并获取消息似乎再次起作用。
我不确定此权限和获取消息之间的联系可能是什么,但也许此信息仍然有帮助。
In our case we got the same error when trying to fetch messages for a channel where the user is not a member of
Error: Access forbidden for identity (status: 403, code: 54007)
. This happened with Twilio SDKtwilio-chat
6.0.0 and 4.1.0.After we reviewed the "Roles and Permissions" section in the Twilio Console we noticed that the "service user" (which is the default user role for the chat user) did not have the permission "editChannelAttributes" activated, as compared to another sub account where fetching messages for unjoined channels was still possible.
Activating the permission "editChannelAttributes" for the service user and fetching messages seems to work again.
I'm not sure what the connection between this permission and fetching messages could be, but maybe this information is still helpful.
这是 Twillio 支持的官方答复,为我们提供了帮助:
This is the official answer from Twillio Support that helped us: