question

shaynes8896 avatar image
shaynes8896 asked David Marginian Deactivated commented

Problems to connect via OAuth

We have no problem connecting using the old method with one permanent token, but when using OAuth and using generated token, we always get unauthorised 401 message.

Please see the following steps and let us know what might be the problem.

1. Log in to CLOVER DASHBOARD

2. SETTINGS, APP ID and APP SECRET

3. In WEB CONFIGURATION will set 'Beta TENANT URL'

4. Log into Beta account in Clover and fill in APP ID and APP SECRET


5. in CLOVER MERCHANT popup “Merchant” is selected

6. CLOVER redirects back to our web app and following data is generated:

/clover/authorized_merchant?merchant_id=mid&employee_id=eid&client_id=clientid&code=code

Merchant Id: mid
Employee Id: ************
Client Id: clientid
Code:code


7. Finally when we are requesting API token : "Request an api token” this one is generated ACCESS TOKEN: token

Only problem is that with this token we are unable to connect.

curl -s https://api.eu.clover.com/v3/merchants/mid/orders --header "Authorization:Bearer token" | python -mjson.tool


{"message":"401 Unauthorized”}

                  
TEST 2: NO ACCESS
This is a test with just generated ACCESS TOKEN via OAUTH 2.0
MERCHANT ID: mid
TOKEN: token



The full audit is summarised here with CURL output failing -



OAuth
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

Thank you for the detailed write-up. I scrubbed all of the ids from your post. From a first look it appears you have correctly followed the process. I noticed your app has the orders read permission, did you assign that permission before or after you pushed the application to your merchant?

10 |2000

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

shaynes8896 avatar image
shaynes8896 answered David Marginian Deactivated commented

We are using REST Clients, so there is no need to install application. When accessing via Clover Dashboard "Example OAuth Request" we get TOKEN, but can’t access with this TOKEN, always returns 401.

Anyway, first step is to set Permissions and after that we start with TOKEN.





1 comment
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

Web app still need to be pushed to a merchant (even though they aren't physically installed on the device). You may want to adjust your app permissions to have employee/customer permissions as both of those may be returned as part of the order and that could be part of the problem.

0 Likes 0 ·

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