@Override public boolean load(String userName, Credential credential) { try { NuxeoOAuth2Token token = getToken(serviceName, userName); credential.setAccessToken(token.getAccessToken()); credential.setRefreshToken(token.getRefreshToken()); credential.setExpirationTimeMilliseconds(token.getExpirationTimeMilliseconds()); return true; } catch (ClientException e) { log.error("Error during token loading", e); return false; } }
getToken may return null.