InvalidAccessToken

I am getting InvalidAccessToken sharing the screen shots below: Need to know what’s wrong.

Get Access Token
Request
https://sandbox.plaid.com/item/public_token/exchange
{
“client_id”: “5cebad8fdeb8a80012316e00”,
“secret”: “1717ab12a74324ffc28242ce4092fe”,
“public_token”: “public-sandbox-caafc99e-645d-4b98-813b-387fffebf045”
}

Response
{
“access_token”: “access-sandbox-a4bdd264-a67d-4436-9fc8-1fc07dfdcc69”,
“item_id”: “5EZ17WLepKIw5PNG33daFVvxLNgo4dtZQ8DQL”,
“request_id”: “VxtWSmNChwsHnzU”
}

Get Dwolla Processor Token
https://sandbox.plaid.com/processor/dwolla/processor_token/create
Request
{
“client_id”: “5cebad8fdeb8a80012316e00”,
“secret”: “1717ab12a74324ffc28242ce4092fe”,
“access_token”: “access-sandbox-a4bdd264-a67d-4436-9fc8-1fc07dfdcc69”,
“account_id”: “GPaEwrj9ZLUXbQvAqqdoFoJqZvZPdaS1llAkZ”
}

Response
{
“processor_token”: “processor-sandbox-2e3caf4e-1a16-4a30-adfa-a670a64c86d9”,
“request_id”: “TYV2FbMsTQuMpda”
}

Attach a Plaid Verified Funding Source to a Customer

https://api-sandbox.dwolla.com/customers/3892459d-e69d-4ca8-b093-e7166ab707ba/funding-sources

Request
{
“name”: “Jane Doe”,
“plaidToken”: “processor-sandbox-2e3caf4e-1a16-4a30-adfa-a670a64c86d9”
}

Resposne
{
“code”: “InvalidAccessToken”,
“message”: “Invalid access token.”
}

Hi @Mahendra_Goyal! Thanks for posting your req/res bodies!

The InvalidAccessToken error represents that the access token used to authenticate with the Dwolla API is not a valid token. To determine what’s causing the issue, would you be able to check for the following,

Please let me know if you have any further questions!

Thanks for your reply as I understand you wish me to use the given url in step 1.

Below is the details:

https://api-sandbox.dwolla.com/token

Authorization : Basic Y2xpZW50X2lkOnRTNXBNQ1VYQ1UzVE5SOGpXT3FMcnFuTXNkd3hrc0t5V3RRMjJ3NTBhVFBsTm51d2h0
Request:
{
“client_id”: “5cebad8fdeb8a80012316e00”,
“secret”: “1717ab12a74324ffc28242ce4092fe”,
“public_token”: “public-sandbox-be4e0635-ab71-4b13-bfbd-ed5e9581400b”
}

Response:
{
“code”: “InvalidCredentials”,
“message”: “Missing or invalid Authorization header.”
}

Hi @Mahendra_Goyal, it seems like the client_id and client_secret that’s being sent in the request to create a Dwolla access_token are Plaid credentials. In order to create a Dwolla access_token, you wouldn’t need to send the Plaid id, secret, and public_token; you would only need to pass,

 grant_type=client_credentials 

in the body of the request along with,

 Content-Type: application/x-www-form-urlencoded

included in the headers.

Additionally, here’s a guide in our Docs on Dwolla’s Authorization flow - https://developers.dwolla.com/guides/auth/
The guide walks you through creating a Dwolla access_token and using it.
I hope that helps! Please let me know if I can help clarify things further!

Tried that as below;

Authorization
Basic Y2xpZW50X2lkOnRTNXBNQ1VYQ1UzVE5SOGpXT3FMcnFuTXNkd3hrc0t5V3RRMjJ3NTBhVFBsTm51d2h0

Request
Content-Type: application/x-www-form-urlencoded
public_token public-sandbox-a90c4f21-635b-46b1-8ca5-ddb36402fe42
grant_type client_credentials

Response
{
“error”: “invalid_client”
}

Hi @Mahendra_Goyal,

What access token did you use to create this customer that you’re using to attach a funding source to? You’ll want to use that same access token to add a bank to that customer record. Also, are you using a Dwolla SDK to make the request to https://api-sandbox.dwolla.com/customers/3892459d-e69d-4ca8-b093-e7166ab707ba/funding-sources or are you using an external HTTP client? Do you have the code snippet of the request you’re making? That may help us debug where you may be going wrong and how you’re initially fetching a Dwolla OAuth access token to authenticate with the Dwolla API. Thanks!

I tried below request with both plaid and dwolla access token:

{
“name”: “Jane Doe”,
“plaidToken”: “processor-sandbox-2e3caf4e-1a16-4a30-adfa-a670a64c86d9”,
“access_token”: “jhhV0kjNVfM8PLaB9svuTPCpE14mK7DlxaFxtY7geKWBX57V5C”
}

But I got

{
“code”: “InvalidAccessToken”,
“message”: “Invalid access token.”
}

I am using Postman

If I pass client and secret as well I get

{
“error”: “invalid_request”
}