NOTES: We have Alt Launch Path added to production This is for web-based OAUTH v2 (not on Clover devices)
We're updating our live app to OAUTH v2 flow and we're experiencing an issue with OAUTH v2 flow in a specific use-case
#1 Merchant clicks a link on our website to connect their Clover
> CONDITION : App has NOT been previously installed OR has been uninstalled
Action:
A merchant clicks a properly constructed link to initiate OAUTH v2 on our website:
https://www.clover.com/oauth/v2/authorize?client_id={APP-ID}&redirect_uri={OAUTH Site-URL}/{Launch Path}&response_type=code&state={STATE-UUID}
Expected behavior:
Merchant is redirected to Clover.com->AppMarket->AppListing (logs in and selects mid if necessary)
Merchant selects a subscription and clicks "Connect"
Merchant is redirected to:
{OAUTH Site-URL}/{Launch Path}?merchant_id={MID}&client_id={APPID}&state={STATE-UUID}&employee_id={EMPLOYEE-ID}&code={AUTH CODE}
Actual Behavior:
Merchant is redirected to Clover.com->AppMarket->AppListing (logs in and selects mid if necessary)
Merchant selects a subscription and clicks connect
Merchant is redirected to:
{OAUTH Site-URL}/{Launch Path}?merchant_id={MID}&client_id={APPID}
>> We're missing a CODE parameter in the url and can not proceed to next step to request a token . In the flow diagram on this page : https://docs.clover.com/docs/high-trust-app-auth-flow it states that we should be receiving CODE. We're also missing STATE that was passed to auth endpoint.
>> This flow behavior is the same if the merchant initiated it by clicking "connect app" or "open installed app" from the marketplace listing/left panel, but according to the docs, it should properly redirect with CODE param.
#2 Merchant clicks a link on our website to connect their Clover
> CONDITION : App has been previously installed
Action:
A merchant clicks a properly constructed link to initiate OAUTH v2 (same as in #1)
https://www.clover.com/oauth/v2/authorize?client_id={APP-ID}&redirect_uri={OAUTH Site-URL}/{Launch Path}&response_type=code&state={STATE-UUID}
Expected behavior:
Merchant is redirected to clover.com (logs in and selects mid if necessary) and then redirected to:
{OAUTH Site-URL}/{Launch Path}?merchant_id={MID}&client_id={APPID}&state={STATE-UUID}&employee_id={EMPLOYEE-ID}&code={AUTH CODE}
Actual Behavior matches expected:
Merchant is redirected to:
{OAUTH Site-URL}/{Launch Path}?merchant_id={MID}&client_id={APPID}&state={STATE-UUID}&employee_id={EMPLOYEE-ID}&code={AUTH CODE}
>> This use-case works. We have the "state" and "code" and are able to get refresh+access tokens from oauth/v2/token
--------
Please advise