Class CloverAuth


  • public class CloverAuth
    extends Object
    Obtain authentication information. The primary use of this class is to get the Clover cloud base URL (see CloverAuth.AuthResult.baseUrl) and access token (see CloverAuth.AuthResult.authToken) used for REST API calls to the Clover cloud.

    The information returned from authenticate(Context, boolean, Long, TimeUnit) is cached for 24 hours on the device. After 24 hours the information is validated with the Clover cloud. This means that periodically, a call to authenticate(Context, boolean, Long, TimeUnit) will result in a blocking network request. Your app should be prepared for this. Do not call this method on the main UI thread, and be prepared to communicate any delays to the user. Access tokens are guaranteed to be valid for at least 24 hours. There is no situation where you can obtain an invalid access token from this method, as long as your app is a valid Clover app in the Clover cloud and is installed to this merchant.

    The information returned from authenticate(Context, boolean, Long, TimeUnit) should not be persisted or cached. Call this method prior to all request to the Clover cloud.

    The forceValidate argument to authenticate(Context, boolean, Long, TimeUnit) causes the token to be validated always, as opposed to every 24 hours as noted above. Use of this is atypical.

    The app invoking methods in this class must be published Clover developer app and be installed to this merchant in the Clover cloud to succeed. It is not sufficient to only sideload an app.

    See this Clover documentation for more information about making REST API calls from a Clover app.