if (tempToken == null || tempTokenSecret == null) {
throw new FitbitAPIException("Resource credentials for resource " + user.getUserId() + " are in an invalid state: temporary token or secret is null.");
}
// Get and save token credentials:
AccessToken accessToken = client.getOAuthAccessToken(tempToken, tempTokenSecret, resourceCredentials.getTempTokenVerifier());
resourceCredentials.setAccessToken(accessToken.getToken());
resourceCredentials.setAccessTokenSecret(accessToken.getTokenSecret());
resourceCredentials.setResourceId(accessToken.getEncodedUserId());
}