Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions docs/guides/managing-identities.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,23 @@ icp identity import my-identity --read-seed-phrase

Sign in to a web-based authentication service and link the resulting identity into icp-cli. **Internet Identity** is one example; the icp-cli default points at [id.ai](https://id.ai), but any service that publishes a `/.well-known/cli-auth-config` for the icp-cli web-auth protocol works the same way.

With Internet Identity, every app sees a *different* principal for the same user. Linking a web-based identity means picking which app you want to sign in *as*. Pass that app's domain with `--app`:
The simplest form gives icp-cli its own account with the auth provider (id.ai uses `cli.id.ai`), and works without any further setup:

```bash
icp identity link web my-cli-identity
```

This prints the sign-in URL and waits for you to press Enter, then opens your browser at the auth provider's sign-in page. Once you complete sign-in, the browser hands the delegation back to icp-cli and the identity is stored locally under the chosen name.

### Signing In As a Specific App

With Internet Identity, every app sees a *different* principal for the same user. To get the same principal an app sees in its own UI — your NNS neurons, your OISY wallet — pass that app's domain with `--app`.

This requires one prerequisite: **you must enable CLI access for your Internet Identity first.** Internet Identity will not hand a command-line tool a delegation for another app's domain unless you have. Until you do, the sign-in page shows *"CLI access not enabled"* and the command never receives an identity.

To enable it, sign in at [id.ai](https://id.ai) (Internet Identity), open your identity settings, and turn on **CLI access**. The setting is stored per browser and per identity, so enable it again on any other device or browser you sign in from.

Then link the identity:

```bash
# Sign in as your NNS identity
Expand All @@ -154,13 +170,7 @@ icp identity link web nns-identity --app nns.ic0.app
icp identity link web oisy-identity --app oisy.com
```

This opens your browser at the auth provider's sign-in page. Once you complete sign-in, the browser hands the delegation back to icp-cli and the identity is stored locally under the chosen name. The resulting principal matches the one the app would see in its own UI. Note that apps may use `alternativeOrigin` with II - the correct domain is `nns.ic0.app`, not `nns.internetcomputer.org`, which would give you a different principal.

When `--app` is omitted, the auth provider picks its own default (id.ai uses `cli.id.ai`):

```bash
icp identity link web my-cli-identity
```
Some apps use II's `alternativeOrigin` mechanism, so the domain Internet Identity knows them by is not the one in your address bar — passing the wrong one links a different principal. `--app` needs the II origin. NNS is the common case: its II origin is `nns.ic0.app`, and icp-cli maps `nns.internetcomputer.org` onto it for you, so either spelling links the same identity.

### Using a Different Auth Provider

Expand Down
Loading