question

davetherock avatar image
davetherock asked jamekaelso343 answered

OAuth 2.0 - Failed to validate authentication code - Clover redirects to '/oauth/authorize' instead of /oauth/v2/authorize

I recently built my app's OAuth v2 integration in sandbox, and kept running into:

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

Turns out, the code being passed to my API was from 'oauth/authorize' instead of '/oauth/v2/authorize'. This is the default for navigating from the left panel in sandbox as well as the default for clicking "Example OAuth Request" in the Edit REST Configuration Menu.

SOLUTION:

Change

https://sandbox.dev.clover.com/oauth/authorize?client_id={CLIENT_ID}

to

https://sandbox.dev.clover.com/oauth/v2/authorize?client_id={CLIENT_ID}
OAuthAuthauth tokens
10 |2000

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

jamekaelso343 avatar image
jamekaelso343 answered

"It’s great to see such detailed troubleshooting for an OAuth 2.0 issue! Understanding the redirect behavior and the difference in endpoints is crucial for proper integration. This discussion will definitely help developers facing similar challenges streamline their authentication process. Kudos to everyone contributing to a solution to learn more



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