Hi there.

I am using the REST API in the sandbox, and the access token for the merchant is stated as no longer being valid.

I have tried uninstalling/reinstalling the app and refreshing the cache inside the app market, but each time the app is installed I retrieve the same access token.

Please help me clear this cache properly so I can retrieve a new access token.

asked 2017-02-06 11:28:10 -0500

jeremyinvoiceasap gravatar image

1 answer

Sort by  

For the time being, if you're grabbing the device auth token, use the method with three arguments, last being boolean to check the server for valid auth token.

//    AuthResult authenticate(Activity activity, Account account, boolean forceValidateToken, Long timeout, TimeUnit unit)

`token = CloverAuth.authenticate(getBaseContext(), CloverAccount.getAccount(getBaseContext()), true, 1000l, TimeUnit.MILLISECONDS).authToken;`

answered 2017-02-06 15:38:20 -0500

Sam gravatar image

updated 2017-05-05 13:29:42 -0500


And please, only pass the force argument if you get a failure, and implement it such that you will give up after some number of retries (don't get into a tight loop calling authenticate() with force=true).

jeff gravatar image
jeff 2017-02-06 15:45:45 -0500

Hey, android studio reports that he can't resolve authenticate method taking three arguments and it won't let me build apk too. Am i missing something? Is there another workaround?


Loyalzoo gravatar image
Loyalzoo 2017-03-01 16:21:07 -0500

@Loyalzoo, can you post a code snippet?

Sam gravatar image
Sam 2017-03-07 13:05:15 -0500

Hey Sam, sorry for the delay, here is the snippet:

final Account account = CloverAccount.getAccount(context); try { final CloverAuth.AuthResult auth = CloverAuth.authenticate(context, account, true); } catch (OperationCanceledException | IOException | AuthenticatorException e) { e.printStackTrace(); }

Android studio reporting: "Cannot resolve method 'authenticate(android.context.Context, android.account.Account, boolean)'"

Loyalzoo gravatar image
Loyalzoo 2017-03-13 04:12:03 -0500