I'm trying to implement the Autho2.0 flow but running into some inconsistencies.
If the user is already logged into clover and installs the app they are taken to the redirect_uri set in the REST settings. It passes along app_id,client_id and code which I should be able to use to get an access token by sending a post request to
https://apisandbox.dev.clover.com/oauth/v2/token
with my app secret,client_id,code,merchant_id. However I always get an error
Failed to validate authentication code.
, which makes no sense because clover generated the code and sent it to my uri because they are already authorized by clover.
How do I get an access_token when the user is already logged into clover and clicks on my app from the dashboard without having to send them back to the /oauth2/v2/authorize endpoint.
I have a work around but its not pretty.