Best answer

Setup custom OAuth 2.0 - This account is expired.Please reconnect it here.

  • 30 July 2022
  • 4 replies
  • 36 views

Hi, I have set up my own OAuth2 service and am now trying to connect Zapier to it!

All looks fine when trying to log in:

  1. Zapier goes to the Authorization URL
  2. User logs in and gets redirected to the URL that creates the Authorization Code
  3. The access code gets created in my app and sent back to Zapier (return_url)
    https://zapier.com/dashboard/auth/oauth/return/App0CLIAPI/?state=111.111&code=SECRET
  4. Zapier goes to the Access Token Request URL and gets the Code back in JSON format.
  5. All seems fine, but Zapier tells me that “This account is expired.Please reconnect it here.”

What could be going wrong here?
All steps seems fine in my logs.
The Access Token Request URL returns the Authorization Code in below format:

{
"access_token": "SECRET_Authorization_Code",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "create"
}

Kind regards /K

icon

Best answer by Kermit 1 August 2022, 16:53

View original

4 replies

In the below post I found out that the error is probably due to the test endpoint / function not working. This seems logical since I get the error below.

I initially had the test endpoint (/me) set up as a POST, but have changed it to a GET to match my Zapier config.

The strange thing is that I have tested my /me endpoint in Postman, but Zapier reports:

The app returned "Error".
What happened (You are seeing this because you are an admin):
Stack trace:
ResponseError: {"status":404,"headers":{"content-type":"text/html; charset=utf-8","retry-after":null},"content":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /oauth/me</pre>\n</body>\n</html>\n","request":{"url":"https://mydomain.com/oauth/me"}}
at _throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:13:11)

Also, there are no logs indicating that Zapier have tried to access the test (/me) endpoint.

UPDATE

Apparently it takes up to 30 minutes for Zapier to update the config.

The call is now working as expected! 🤓🎉

Answer

  1. The message “This account is expired.Please reconnect it here.” means that the test (/me) endpoint is not working as expected.
  1. Make sure to use the correct verb (GET / POST) for the test (/me) endpoint
  2. It might take Zapier up to 30 minutes to detect that your test endpoint has updated with new code
  3. I found it helpful to include more data in the test endpoint to be able to verify the user.

Happy coding!

Userlevel 7
Badge +9

Yay! 🎉 Glad to hear you were able to get this sorted on your own. Thanks so much for following up and updating the Community with your solution! 🤗

Reply