200 Status Code with Error on Authentication

(Jordan Juel) #1

I am wondering if it is normal to get a 200 Status Code (Ok) on authentication even when I deliberately pass in the wrong auth credentials?

It was a little tough to debug the issues when I was receiving a 200 status code, but the Token response was empty. It wasn’t until I dumped the full response that I discovered that despite the 200 status code that I was receiving errors back. I was unaware it was even possible to receive errors back in the Token Response (not listed in API documentation). Is it possible to receive any of the error codes described here: https://docsv2.dwolla.com/#errors on the auth request? I am using Golang for the record. Thanks!

(Spencer Hunter) #2

Hey @jjuel, Unfortunately the token endpoint is shared by our legacy v1 API, and doesn’t incorporate very good RESTful API principles by making use of the proper HTTP status codes. It is possible to get an error response with a 200 status code when calling the token endpoint. You’ll want to use the message that is returned in the response body to determine if there was in fact an error with the request.

Here are the possible errors when POSTing to the token endpoint to obtain an app access token:

  • Invalid application credentials.

  • Application is suspended.

  • Invalid grant type.

            "error": "access_denied",
            "error_description": "Invalid application credentials."