question

kacyjames avatar image
kacyjames asked kacyjames commented

Clover Cloud Connector Example Fails, Returns 401 Unauthorized

I'm using the Clover Cloud connector example app to test out my Clover dev kit: https://github.com/clover/clover-clou...

The application is unable to authenticate and https://sandbox.dev.clover.com/v3/mer... returns a 401 after successfully getting an access token back from the sandbox server. As a result, I can't initiate a connection with the device. I've created a web application in the dashboard with a site URL and a CORS domain.

Is there anything else necessary to complete setup so I can test the device?

6 comments
10 |2000

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

rachel avatar image rachel commented ·

I'm confused by your visiting the /v3/merchant/{merchantId} endpoint in the context of the cloud connector example. The cloud connector example is a browser-based POS that communicates with a Clover mini to take payments. You're running the node server and are configuring the app via the modal window? The mini itself has Cloud Pay Display installed?

0 Likes 0 ·
kacyjames avatar image kacyjames commented ·

Hi Rachel, Cloud Pay Display is installed. Initially when selecting the 'http://sandbox.dev.clover.com' option in the device configuration modal, I'm successfully taken through the authentication flow and redirected to my app. For some reason though, none of the devices associated with my merchant show up in the dialog after the redirect.

The application calls this endpoint when I select 'http://sandbox.dev.clover.com' again from the 'clover device configuration modal' after the redirect:

https://sandbox.dev.clover.com/v3/mer...

0 Likes 0 ·
rachel avatar image rachel commented ·

Hmm. Check the permissions you gave the web app by visiting the app's settings page on the developer dashboard; make sure it can read merchant data. If you change the permissions, you'll have to un- and re-install the app from your test merchant (since permissions are approved upon installation).

0 Likes 0 ·
kacyjames avatar image kacyjames commented ·

Thanks for the tip Rachel! Since there doesn't appear to be a way to delete a web application from the terminal, I created a new application with all of the proper permissions. The new application has no problem getting a list of devices!

Unfortunately, the application can't send messages to the device, the application gets a 401 when it attemps to contact https://sandbox.dev.clover.com/v2/mer...pay?accesstoken=<access_token>. I don't see the remote pay permission listed in the application preferences, is there another place that needs to be enabled?

0 Likes 0 ·
rachel avatar image rachel commented ·

Awesome! I'd guess there was a caching issue where the old token that didn't have the correct permissions was being used instead of the new one.

0 Likes 0 ·
Show more comments

1 Answer

kacyjames avatar image
kacyjames answered

UPDATE: I just attempted to use the app in an incognito window and everything worked as expected. Can't say for sure what the issue was.? Thanks for all of your help!

10 |2000

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