Can't finish oauth process -- invalid credentials


(Malcolm Mac Kinnon) #1

As outlined in the v2 api here, https://docsv2.dwolla.com/#finish-user-authorization, I’ve been unable to finish authorization process in my python app. After contructing a url, I’m able to retrieve the code in my callback url, but when I submit the code for verifcation I get a 200 response with the following error:
{“error”:“access_denied”,“error_description”:“Invalid application credentials.”}’

I’m using the python requests module as follows:
par={
“client_id”: “my_app_keyo9jzD7RflrdlHc9KXH790v0Jkd8QIX3utuvcZRgOMkOa”,
“client_secret”: “my_secret_ido9jzD7RflrdlHc9KXH790X3utuvcZRgOMkOa”,
“code”: “8HqdIM3aWGiM5fKW0iEUvnYeJlrP”,
“grant_type”: “authorization_code”,
“redirect_uri”: “https://localhost:8000/polls/redirect
}
par=json.dumps(par) #encodes to json
import requests
url='https://uat.dwolla.com/oauth/v2/token
headers={‘Authorization’: ‘Bearer pLhLWet9AyuRgghBeU0cyHB3nfGEJFoGqyiddsIhYxF7eZ3hTT’, ‘Content-Type’: ‘application/vnd.dwolla.v1.hal+json’, ‘Accept’: ‘application/vnd.dwolla.v1.hal+json’}

get_tokens=requests.post(url=url, params=par, headers=headers)
get_tokens.content
b’{“error”:“access_denied”,“error_description”:“Invalid application credentials.”}’

I’ve tried this a number times and in a number of different ways. For example, I changed the header to read only ‘Content-Type’: ‘application/json’ (as recommended in some earlier posts), but still get the same error. I’ve also tried the python-dwollaswager code, but could not find the method for this particular step anywhere in the api docs. Sorry to post this problem twice. I’m new here. Any help would be greatly appreciated.


(Spencer Hunter) #2

Hi @Malcolm_MacKinnon, see my response here:

It’s the Authorization header that you are passing in which is causing issues with the token request. Unfortunately the python swagger SDK doesn’t contain support at this time and we are working on resolving this issue.