HashiCorp Vault
:::tip[]
Vault secrets is available on Apidog Enterprise plan.
:::
Apidog supports integration with both the community and cloud editions of HashiCorp Vault. It supports two auth methods: token and OIDC.
Configure vault provider: Community edition
Token
- Enter URL. By default, the local Vault service runs on
http://127.0.0.1:8200
. - Enter token. The token is NOT uploaded to the server and is NOT shared with others on the team.
- Click "Test Connection". If everything is correct, "Succeeded" will be displayed.
OIDC
Please enable and configure OIDC auth method first. When configuring a third-party OAuth2.0 service provider, please add Apidog's callback URL.
Then, proceed to Apidog:
- Enter URL. By default, the local Vault service runs on
http://127.0.0.1:8200
. - Enter auth URL. By default, it is
http://127.0.0.1:8200/v1/auth/oidc/oidc/auth_url
. - Enter access token URL. By default, it is
http://127.0.0.1:8200/v1/auth/oidc/oidc/callback
. - Click "Test Connection", and the OAuth2.0 login window will pop up. After you log in, "Succeeded" will be displayed.
Configure vault provider: HCP Vault Dedicated (Cloud edition)
Token
- Enter URL, which you can find in the HashiCorp Cloud Portal.
- Enter namespace. The default namespace called
admin
. - Enter token. You can click "Generate Token" in the HashiCorp Cloud Portal to create one. The token is NOT uploaded to the server and is NOT shared with others on the team.
- Click "Test Connection". If everything is correct, "Succeeded" will be displayed.
OIDC
Please enable and configure OIDC auth method first. When configuring a third-party OAuth2.0 service provider, please add Apidog's callback URL.
Then, proceed to Apidog:
- Enter namespace. The default namespace called
admin
. - Enter auth URL. The format is
{{VAULT_ADDR}}/v1/auth/oidc/oidc/auth_url
. - Enter access token URL. The format is
{{VAULT_ADDR}}/v1/auth/oidc/oidc/callback
. - Click "Test Connection", and the OAuth2.0 login window will pop up. After you log in, "Succeeded" will be displayed.
Link secrets
Whether you use the community edition or the cloud edition of HashiCorp Vault, the way to link secrets is the same.
If you created the secret using the CLI, you will see output like this on the console:
$ vault kv put -mount=secret hello foo=world
== Secret Path ==
secret/data/hello
======= Metadata =======
Key Value
--- -----
created_time 2022-06-15T19:36:54.389113Z
custom_metadata <nil>
deletion_time n/a
destroyed false
version 1
In the Web UI, the secret just created will appear as shown below:
To link the secret created above, you need to enter the metadata as shown below:
Finally, click the "Fetch Secrets" button. Then click the eye icon on the right to view the value of the secret.