Update token for hashicorp credential

Update token for hashicorp credential

avatar

Hi,

How can I update the token for connectiontype "credential" and credentialtype "hashicorpVault" ?

I tried set-rdmentrypassword , no change.

thanks you

The xml is:

<?xml version="1.0" encoding="utf-8"?>
<RDMExport>
  <Connections>
    <Connection>
      <ConnectionType>Credential</ConnectionType>
      <ID>2fbbe2fb-1f05-4d8a-9f93-34a5a8374c8c</ID>
      <Name>MY-VAULT</Name>
      <Credentials>
        <CredentialType>HashiCorpVault</CredentialType>
        <HashiCorpVaultAlwaysPromptWithList>true</HashiCorpVaultAlwaysPromptWithList>
        <HashiCorpVaultServer>https://my.vault.server</HashiCorpVaultServer>
        <SafeHashiCorpVaultToken>b3f90GoGTtHARPA76il/NDUIc+B3v9N8Qa5hZP8ROw3LvrWfOzFmRjsuA39Hin6OwdzrJbM/8b1ZulIIROEgQ5qb2iZLCfCY7T+dTL4fvwmx8nKw9mvHvISolVYWUGTHHRI6S1emUS0=</SafeHashiCorpVaultToken>
      </Credentials>

All Comments (4)

avatar

Hello,

This is not currently possible, but a fix will be included in the next release to support this functionality.

Best regards,
Maxime

avatar

Ok, thanks you !

avatar

Hello Joffrey,

Starting with version 2025.2.6 of the module, it's possible to modify the token directly. To do so, simply set the HashiCorpVaultToken property on the object like this:

$entry.Credentials.HashiCorpVaultToken = 'myToken'
Set-RDMEntry -InputObject $entry


Let us know if you need anything else.

Best regards,
Maxime

avatar

Hi @Maxime Bernier ,

it works !
But, I recommend supporting the "approle" authentication method, since tokens inevitably expire after a maximum of 30 days. This means I had to automate the token renewal process.
While "ldap" is supported, it’s not really suitable for an application. Using "approle" is the better choice.

Thanks you