requestAccessToken

abstract fun requestAccessToken(): Single<String>

Requests a valid access token. This should be called before every use to ensure the token has not expired. The token is automatically refreshed when it expires.

If the refresh token has expired, a http error code 401 will be returned and the user will have to login again. If the time out is reached, a SocketTimeoutException will be thrown, the user is still considered logged in.

Throws

if trying to request a AccessToken before user has logged in, or after any case where the token has been cleared

HttpException

if the network request fails

if the network request times out (in case of no or slow network)