【问题标题】:salesforce api integration through Alamofire?通过 Alamofire 集成salesforce api?
【发布时间】:2019-01-12 05:08:04
【问题描述】:

通过 Alamofire 集成 auth api 时,出现错误。

http://test.salesforce.com/services/oauth2/token

Optional(["Content-Type": "application/x-www-form-urlencoded"]) 

参数:client_id=3MVG9e2mBbZnmM6lFmND2Ju7xFYp.iaixYWQ7tuDZKWs4Jqs9pxjm3kenjwAqhG28yWavIReD9wkchzFaBcMO&client_secret=8967652660758155787&grant_type=password&password=qwerty%4012&username>

回复:

error = "unsupported_grant_type"; "error_description" = "不支持授权类型";

我正在通过 POSTMAN 收到回复,所以我有什么遗漏吗?

【问题讨论】:

    标签: swift salesforce alamofire swift4


    【解决方案1】:

    Salesforce 不支持访问令牌请求中的 JSON; the OAuth 2.0 spec mandates application/x-www-form-urlencoded.

    【讨论】:

    • 内容类型设置为“application/x-www-form-urlencoded”
    猜你喜欢
    • 2019-11-16
    • 1970-01-01
    • 1970-01-01
    • 2017-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多