I am trying to use OAuth authentication to get the Salesforce Authentication Token, so I referred wiki docs, but after getting authorization code, when I make a Post request
I had the same error with all keys set correct and spent a lot of time trying to figure out why I cannot connect.
Finally I've found that in Setup -> Manage Connected Apps -> Click "MyAppName" -> Click "Edit Policies".
In the 'Permitted Users' field value "All users may self-authorize" should be set.