Frogger
Frogger

Reputation: 86

SimpleAuth + Instagram + Swift, Code 400, OAuthException

I am using SimpleAuth to attempt to enable instagram authorization in my app.

As per SimpleAuth (https://github.com/calebd/SimpleAuth/wiki/Instagram) requirements, I've set it up like so:

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

To initialize my instagram settings and this to set up my parameters:

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

In response I have been receiving this error:

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

Also, when I use:

var response = responseObject as NSDictionary

I get a "Use of a unresolved identifier "response"Object" error.

I feel like I've tried almost everything, does anybody have any ideas? Thanks ahead of time.

Upvotes: 0

Views: 660

Answers (1)

Alexey Sobolevsky
Alexey Sobolevsky

Reputation: 157

You have a wrong key in your configuration dictionary. You should use client_id instead of myclientid.

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

Upvotes: 1

Related Questions