question

dav1126 avatar image
dav1126 asked submatic answered

First token request not working on OAuth 2.0

I can't make the requests to get a first token to work in the new oauth flow. The old flow was working fine for me.

The only differences that I can see in the doc is that the production URL changed from https://www.clover.com to https://api.clover.com. The route changed from /oauth/token to /oauth/v2/token and the the request is now a POST instead of a GET. The params (client_id, client_secret and code) are now passed in the POST request body instead of the GET search params. They are the only changes I made. The new oauth API always returns :

401 {"status":"Unauthorized","message":"Failed to validate authentication code."}

It happens in sandbox and production environment. If it helps, doing the exact same resquest ( a POST with params in the body) on the old API route ( /oauth/token ) succeeds and gets me an access_token, but no refresh_token.

Prod app id: XX4047T4M54AY

OAuthaccess token
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bryanvargas avatar image
bryanvargas answered submatic commented

Are using the new Authorization code that is generated from the authorize endpoint?

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

submatic avatar image submatic commented ·

@bryanvargas I am encountering various issues with the OAuth 2 workflow. Does not work if done via the left pane logged in view. Yesterday it was working for me when initiated from my app but today it is not as there appears to be a 500 internal server error triggered on Clover's side when attempting to do the installation.

0 Likes 0 ·
submatic avatar image
submatic answered

Seems like it works if using https://apisandbox.dev.clover.com

Most of the documentation references the url https://sandbox.dev.clover.com

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community