question

woolton-dev avatar image
woolton-dev asked rmgas commented

Android oAuth without login

We were told by the App Market Operations person at Clover that we need to redo our login implementation on Android to use oAuth without having the user physically login. We have searched and have been unable to find a way of doing this on Android through the documentation. The only example (linked from the docs) is here:

https://github.com/clover/android-examples/tree/master/oauthexample

This example has no way for the Android app to login without user intervention. So let me just quote what we were told:

"The app should use OAuth to automatically sign in the merchant, requiring a manual login each time will can be frustrating for the merchants"

Our response:

"In regards to oAuth, we only require this one time. Assuming the user never clears the cache/data of the app, they will never have to do this again. We tried to use the oAuth to auto login, but it doesn’t appear to work in our case. Our back-end does a daily download of the merchant’s data, this is in order for the app to show the reports. We have to do this on the back-end, because this is not possible on the app (the process is too complicated, and these mobile devices are not capable of processing it fast enough). So using the token that’s provided for Android, does not work."

Final response from Clover:

"The online OAuth is working properly, but the device OAuth process is not. It seems like the information is being dropped on your end rather than validating. I did check with one of my dev team members and the OAuth process is definitely doable on your end. I would recommend reading through the OAuth documentation at docs.clover.com, and posting any question you have at devask.clover.com."

I'm not sure if we're understanding correctly, but how can make this automatic? We're going to review about this problem, but if we're understanding this wrong I would just prefer to get a confirmation from a dev of the Clover team here.

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.

1 Answer

woolton-dev avatar image
woolton-dev answered rmgas commented

So it turns out it is possible. It just wasn't working with the sample we downloaded from GitHub. When we added it to our actual app, the token worked.

2 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.

rmgas avatar image rmgas commented ·

Could you explain in detail and maybe provide sample code of how you accomplished this? I'm developing a Java application to pull data from Clover for reporting purposes. The idea is to have the program run as part of a cron job once daily and because of that, logging in isn't an option.

0 Likes 0 ·
woolton-dev avatar image woolton-dev commented ·

rmgas, if you're using just an application and no server-side, then just use the Clover SDK to accomplish this (using the merchant methods). If it's the server-side that needs to download the data, then from the application upload to the server the merchant UUID and the generated auth token (from the Android SDK). Let me know which one it is and I could provide more details if you need more details.

0 Likes 0 ·

Welcome to the
Clover Developer Community