diff --git a/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultClientProvider.java b/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultClientProvider.java index c1e3994..537b0a0 100644 --- a/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultClientProvider.java +++ b/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultClientProvider.java @@ -182,8 +182,7 @@ private String getVaultAuthToken() throws ConfigurationException, VaultException } catch (VaultException e) { throw new ConfigurationException( - String.format("Encountered error while authenticating with %s", - vaultAuthBackend) + String.format("Encountered error while authenticating with %s: %s", vaultAuthBackend, e.getLocalizedMessage()) ); } break; diff --git a/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultStoragePlugin.java b/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultStoragePlugin.java index bb097ea..d25d2f4 100644 --- a/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultStoragePlugin.java +++ b/src/main/java/io/github/valfadeev/rundeck/plugin/vault/VaultStoragePlugin.java @@ -269,8 +269,8 @@ private boolean isDir(String key) { protected void lookup(){ try { - long ttl = getVaultClient().auth().lookupSelf().getTTL(); - if (ttl <= guaranteedTokenValidity) { + LookupResponse lookupSelf = getVaultClient().auth().lookupSelf(); + if (lookupSelf.getTTL() <= guaranteedTokenValidity || lookupSelf.getNumUses() < 0) { loginVault(clientProvider); } } catch (VaultException e) {