If you have a command like vault auth enable oidc
, how do you know its corresponding API call? Like this:
vault auth disable -output-curl-string oidc
Here's an example:
$ vault auth enable oidc
Success! Enabled oidc auth method at: oidc/
$ vault auth disable oidc
Success! Disabled the auth method (if it existed) at: oidc/
$ vault auth enable -output-curl-string oidc
curl -X POST -H "X-Vault-Request: true" -H "X-Vault-Token: $(vault print token)"
-d '{"type":"oidc","description":"","config":{"options":null,"default_lease_ttl
":"0s","max_lease_ttl":"0s","force_no_cache":false},"local":false,"seal_wrap":fa
lse,"external_entropy_access":false,"options":null}' http://127.0.0.1:8200/v1/sy
s/auth/oidc
$ vault auth disable -output-curl-string oidc
curl -X DELETE -H "X-Vault-Request: true" -H "X-Vault-Token: $(vault print token
)" http://127.0.0.1:8200/v1/sys/auth/oidc
For more on the easy way to use the Vault API got get or generate "Secrets," I recommend this link:
https://www.slideshare.net/mitchp/vault-secrets-via-api-for-the-rest-of-us
Top comments (0)