curl. The same pattern applies for other auth methods (e.g., GitHub, LDAP, AWS).
Prerequisites
Installing
jq is optional but recommended for readable JSON outputs.1. Authenticate via Okta
First, create a JSON file namedpassword.json containing your Okta password:
you@example.com with your Okta username:
client_token in the auth block:
jq:
client_token value.
2. Read a Secret from the KV Store
With yourclient_token, you can query Vault’s KV store. In this example, we read from secret/data/app01 (KV version 2):
Never expose your
client_token in shared scripts or logs. Treat it like a password.3. Summary of Endpoints
Conclusion
You have now:- Authenticated to Vault using the Okta auth method.
- Extracted the
client_tokenfrom the API response. - Retrieved a secret from the KV secrets engine.