src/main/java/com/w3asel/cubesensors/util/CubeSensorsUtils.java
public Token getAccessToken() {

		Token accessToken = authPersistence.getToken();

		if (isTokenValid(accessToken)) {
			return accessToken;
		}
		
		// authorize
		accessToken = authorize();

		// save
		authPersistence.saveToken(accessToken);

		return accessToken;
	}
public Token getAccessToken() {

		Token accessToken = authPersistence.getToken();

		if (isTokenValid(accessToken)) {
			return accessToken;
		}
		
		// authorize
		accessToken = authorize();

		// save
		authPersistence.saveToken(accessToken);

		return accessToken;
	}
Obtain an access token. If previously a token was created and persisted
will be returned after validation (a real call is made to validate).
<p>If no token previously persisted, the method will create a new token using
the authentication provider (AuthProvider)
@return the access token.