LOG.debug("Using OAuth {}", cachedBoxClient);
// authorize App for user, and create OAuth token with refresh token
final IAuthFlowUI authFlowUI = new LoginAuthFlowUI(configuration, boxClient);
final CountDownLatch latch = new CountDownLatch(1);
final LoginAuthFlowListener listener = new LoginAuthFlowListener(latch);
boxClient.authenticate(authFlowUI, true, listener);
// wait for login to finish or timeout
if (!latch.await(configuration.getLoginTimeout(), TimeUnit.SECONDS)) {
if (!boxClient.isAuthenticated()) {
throw new RuntimeCamelException(String.format("Login timeout for %s", cachedBoxClient));