【问题标题】:SimpleAuth + Instagram + Swift, Code 400, OAuthExceptionSimpleAuth + Instagram + Swift,代码 400,OAuthException
【发布时间】:2015-11-12 08:53:19
【问题描述】:

我正在使用 SimpleAuth 尝试在我的应用中启用 Instagram 授权。

根据 SimpleAuth (https://github.com/calebd/SimpleAuth/wiki/Instagram) 的要求,我已将其设置为:

SimpleAuth.configuration()["instagram"] = ["myclientid": "myclientid", SimpleAuthRedirectURIKey: "http://google.com"] 

初始化我的 instagram 设置并设置我的参数:

SimpleAuth.authorize("instagram", options: ["scope" : ["likes", "comments"]], completion: { (responseObject : AnyObject!, error : NSError!) -> Void in })

作为回应,我收到了这个错误:

{
    "code": 400,
    "error_type": "OAuthException",
    "error_message": "You must include a valid client_id, response_type, and redirect_uri parameters"
}

另外,当我使用时:

var response = responseObject as NSDictionary

我收到“使用未解析的标识符”响应“对象”错误。

我觉得我几乎尝试了所有方法,有人有什么想法吗? 提前谢谢。

【问题讨论】:

    标签: ios swift authentication instagram instagram-api


    【解决方案1】:

    您的配置字典中有错误的键。您应该使用 client_id 而不是 myclientid

    SimpleAuth.configuration()["instagram"] = ["client_id": "myclientid", SimpleAuthRedirectURIKey: "http://google.com"] 
    

    【讨论】:

      猜你喜欢
      • 2020-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多