首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Sage One API时出错"unsupported_grant_type“

使用Sage One API时出错"unsupported_grant_type“
EN

Stack Overflow用户
提问于 2015-07-18 12:09:12
回答 1查看 384关注 0票数 0

我正在使用来自Eddie (https://github.com/eddieharrison/sageone-api-php)的Sage Php。我试图使用API进行基本身份验证,但是它返回以下错误:

string(35) "{"error":"unsupported_grant_type"}“int(0)警告: json_decode()希望参数1是string,在第59行的unsupported_grant_type中给出数组

根据Sage One API文档,错误"unsupported_grant_type“发生在给定错误的授予类型时。它应该是authorization_coderefresh_token。但是,在代码中,它显然使用了authorization_code

我已经注意到,我使用的Sage One API库所使用的URL与文档中的URL不同,但即使将它们更改为文档中的URL也不能解决这个问题。

有人知道吗?

EN

回答 1

Stack Overflow用户

发布于 2015-07-21 14:30:50

看起来,令牌请求的数据被序列化为JSON。根据OAuth 2.0规范,实体体的格式应该是“application/x form-urlencoded”。

来源:https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31490994

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档