Currently implementing the new OAuth logic (US) for a low trusted app.
In the Clover Sandbox dashboard for our app, we have the following REST Configuration:
* Site URL: http://localhost:8080/
* CORS Domain: http://localhost:8080
* Default OAuth Response: Token (Testing Only)
Our app redirect to the following endpoint: https://sandbox.dev.clover.com/oauth/v2/authorize?code_challenge={CodeChallenge}&client_id={AppClientId}
After logging in, we are redirected back to our app (localhost), with the following URL parameter:
http://localhost:8080/?merchant_id={MerhcantId}&employee_id={EmployeeId}&client_id={ClientId}&code={Code}
Using VueJs and axios, we make the following Call:
const data = { client_id: clientId, code: code, code_verifier: this.codeVerifier, }; axios .post(`${this.baseUrl}/oauth/v2/token`, data) .then((response) => {} });
When trying to make the API call we get the following error in the console:
Access to XMLHttpRequest at 'https://sandbox.dev.clover.com/oauth/v2/token' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Chrome Network tab has two entries for the API endpoint:
* Status: Cors Error, Type: xhr
* Status: 403, Type: Preflight
Any help resolving this would be much appreciated.