vault/website/content/docs/commands/hcp/connect.mdx
Yoko Hyakuna 2becdceab0
Replace 'HCP Vault' with 'HCP Vault Dedicated' (#26457)
* Replace 'HCP Vault' with 'HCP Vault Dedicated'

* Replace 'HCP Vault' with 'HCP Vault Dedicated' where applicable

* Replace 'Terraform Cloud' with 'HCP Terraform'

* Minor format fixes

* Update the side-nav title to 'HCP Terraform'

* Undo changes to Terraform Cloud secrets engine
2024-04-22 08:44:13 -04:00

61 lines
2.2 KiB
Plaintext

---
layout: docs
page_title: hcp connect - Command
description: |-
Use "hcp connect" command to authenticate users and machines to HCP with explicit
credentials or an HCP token and interactive browser login.
---
# hcp connect
The `hcp connect` command authenticates users and machines to HCP with explicit
credentials or an HCP token and interactive browser login.
By default, the `hcp connect` command uses interactive authentication that requires
users to log into the HashiCorp Cloud Platform with a browser.
Non-interactive login requires a service principal credential that was
previously generated through the HCP portal. The service principal must have
access to the requested organization, project, and HCP Vault Dedicated cluster.
If authentication succeeds, the Vault CLI saves the returned HCP token and HCP
Vault address in the local cache.
## Examples
Connect to HCP interactively:
```shell-session
$ vault hcp connect
The default web browser has been opened at <auth_url>. Please continue the login in the web browser.
Success!
```
## Usage
The following flags are available in addition to the [standard set of
flags](/vault/docs/commands) included on all commands.
### Command options
- `-client-id` `(string: "")` - Client ID belonging to a service principal
credential generated in the HCP Portal. **Required for non-interactive
authentication**.
- `-secret-id` `(string: "")` - Secret ID belonging to a service principal
credential previously generated in the HCP Portal. **Required for
non-interactive authentication**.
- `-organization-id` `(string: "")` - Optional ID of the desired HCP
organization. If `organization-id` is empty and the user is associated with
multiple HCP organizations, the CLI prompts the user to select from a list
of available organizations.
- `-project-id` `(string: "")` - Optional ID of the desired HCP project. If
`project-id` is empty and the user is associated with more than one HCP
project, the CLI prompts the user to select from a list of available projects.
- `-cluster-id` `(string: "")` - Optional ID of the desired HCP Vault Dedicated cluster.
If `cluster-id` is empty and the user is associated with multiple HCP clusters,
the CLI prompts the user to select from a list of available clusters.