> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Vault Authentication using the UI

> This guide demonstrates how to authenticate to HashiCorp Vault using the Vault UI and switch to the CLI.

This guide demonstrates how to authenticate to HashiCorp Vault using the [Vault UI][vault-ui-docs]. You’ll learn how to log in with your preferred method, retrieve your client token, and switch to the CLI.

## Prerequisites

Ensure the following authentication methods are enabled in your Vault cluster:

| Auth Method | Description                 | Documentation                        |
| ----------- | --------------------------- | ------------------------------------ |
| token       | Static token authentication | [Token Auth][vault-token-docs]       |
| userpass    | Username/password login     | [Userpass Auth][vault-userpass-docs] |
| Okta        | Single sign-on with Okta    | [Okta Auth][vault-okta-docs]         |

## Step 1: Access the Vault UI

Open your browser and navigate to:

```text theme={null}
http://<your-vault-address>:8200
```

You will see the login screen where only the enabled methods appear in the dropdown.

<Callout icon="lightbulb" color="#1CB2FE">
  Only methods enabled on your Vault server will show up in the dropdown. Contact your administrator if you need a new auth method enabled.
</Callout>

## Step 2: Select and Authenticate

1. From the dropdown, choose **Okta** (or any enabled method).
2. Enter your **Username** and **Password**.
3. Click **Sign In**.

<Frame>
  ![The image shows a login page for "Vault" with fields for method, username, and password, and a "Sign In" button. The method selected is "Okta," and there are options for more settings.](https://kodekloud.com/kk-media/image/upload/v1752878024/notes-assets/images/HashiCorp-Certified-Vault-Associate-Certification-Demo-Vault-Authentication-using-the-UI/vault-login-page-okta-sign-in.jpg)
</Frame>

After successful authentication, Vault redirects you to its home screen.

## Step 3: Explore the Vault Home Screen

On the UI home screen, you can:

* Browse **Secret Engines** (e.g., `cubbyhole`, `secret`)
* View and manage **Tokens**
* Configure **Policies**

Click the user menu in the top-right corner to copy the client token issued during login.

<Frame>
  ![The image shows a web interface for HashiCorp Vault, displaying a list of secret engines, including "cubbyhole" and "secret." The interface includes options for managing tokens and adding new engines.](https://kodekloud.com/kk-media/image/upload/v1752878024/notes-assets/images/HashiCorp-Certified-Vault-Associate-Certification-Demo-Vault-Authentication-using-the-UI/hashicorp-vault-web-interface-secret-engines.jpg)
</Frame>

## Step 4: Use Your Token in the CLI

Once you have your token, you can authenticate the Vault CLI:

```console theme={null}
# On Windows:
C:\> vault login s.TEKrNn3Cv53pZdbPh8xg41Pu
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.

Key                      Value
---                      -----
token                    s.TEKrNn3Cv53pZdbPh8xg41Pu
token_accessor           M0xoSDLdcWQyI19yLrdUKhI8
token_duration           767h58m21s
token_renewable          true
token_policies           ["bryan" "default"]
identity_policies        []
policies                 ["bryan" "default"]
token_meta_policies      bryan
token_meta_username      bryan@krausen.io

C:\> set VAULT_TOKEN=s.TEKrNn3Cv53pZdbPh8xg41Pu

# On Linux/macOS:
$ export VAULT_TOKEN=s.TEKrNn3Cv53pZdbPh8xg41Pu
```

<Callout icon="lightbulb" color="#1CB2FE">
  After exporting `VAULT_TOKEN`, all subsequent [Vault CLI][vault-cli-docs] commands will use this token automatically. Consider adding this line to your shell profile for convenience.
</Callout>

Switching from the UI to the CLI lets you leverage commands not yet available in the interface.

***

## References

[vault-ui-docs]: https://www.vaultproject.io/docs/ui

[vault-cli-docs]: https://www.vaultproject.io/docs/commands

[vault-token-docs]: https://www.vaultproject.io/docs/auth/token

[vault-userpass-docs]: https://www.vaultproject.io/docs/auth/userpass

[vault-okta-docs]: https://www.vaultproject.io/docs/auth/okta

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/hashicorp-certified-vault-associate-certification/module/eebfb593-8885-43b0-a9ba-9f88af87092e/lesson/a8c5d884-c1a9-4047-bae9-3feeb5be5635" />
</CardGroup>
