android - 在 HMS Push Kit API 中获取访问令牌时出错
问题描述
当我使用此 api 获取访问令牌时:
它总是返回
{
"sub_error": 20001,
"error_description": "missing required parameter: client_id",
"error": 1102
}
虽然我发送 client_id 参数
解决方案
要解决此问题,请确保以下几点
您正在向服务器发送请求
确保POSR URL为“https://oauth-login.cloud.huawei.com/oauth2/v3/token”。
不要在 URL 中包含 post 参数,在 POST 请求的正文中添加以下参数(如果您使用 postman 工具,您可以找到添加参数的字段)
grant_type=client_credentials
client_id=您的客户 ID
client_secret=您的客户密码
有关获取访问令牌的更多详细信息,请参阅以下链接:
推荐阅读
- python - 使用 Python 处理包含矩阵的函数的牛顿方法
- xquery - 查询。如何查看当前的增量备份状态?
- python - grpc-Python max_workers 限制同时进程的数量
- c# - 反序列化对象
- amazon-web-services - 降低 AWS 中的数据传输成本
- php - 使用 Ajax 时如何访问购物车 id 的会话变量?如何设置属性?
- angular - 是否可以在从服务器获取之前过滤 api 数据?
- python-3.x - 如何使用 Matplotlib 更改我的代码以停止 DepreciatonWarning:使用或从“集合”导入 ABC
- lua - 如何修改由 C API 创建的元表?
- amazon-web-services - 禁用 AWS Api Gateway http --> https 307 重定向