Skip to content

docs: state the CLI access prerequisite for identity link web --app - #695

Merged
marc0olo merged 2 commits into
mainfrom
docs/identity-link-web-cli-access
Aug 6, 2026
Merged

docs: state the CLI access prerequisite for identity link web --app#695
marc0olo merged 2 commits into
mainfrom
docs/identity-link-web-cli-access

Conversation

@marc0olo

@marc0olo marc0olo commented Aug 6, 2026

Copy link
Copy Markdown
Member

Context

We received this feedback on icp identity link web:

Hello SDK team, I was very excited when I saw in the icp-cli docs the example of linking the nns.ic0.app identity with icp-cli. The excitement disappeared when I tried it out and II told me that the NNS dapp doesn't support it. The same happens for oisy.com. How about changing the example to something that is actually supported?

Both examples are supported. Internet Identity gates a delegation for another app's domain behind a per-identity CLI access setting, and without it the sign-in page shows "CLI access not enabled". Our guide never mentioned the prerequisite, so the screen reads as a capability limitation rather than a setting the user can flip.

The gate applies specifically to --app. Linking without it — where II hands icp-cli its own account at cli.id.ai — is not gated, which is why the plain example works and the two documented ones don't.

Changes

Restructures Linking a Web-Based Identity in the identity guide so the working path leads:

  • Opens with icp identity link web <name>, flagged as working without further setup.
  • New Signing In As a Specific App subsection for --app, stating the CLI access prerequisite before the examples: what the failure looks like, how to fix it (sign in at id.ai → identity settings → CLI access), and that the setting is per browser and per identity.
  • Keeps the alternativeOrigin / nns.ic0.app note, now attached to the --app section where it applies.

Docs only, no behavior change.

For discussion: the CLI still hangs silently

Worth raising separately, because docs only help people who read them before running the command — the reporter was looking at a spinner.

When II reaches its cli-disabled state it renders that screen and stops there, without posting anything back to our loopback callback — the POST happens only on the path past the gate. recv_delegation has no timeout, so the CLI sits on ⠹ Linking web-based identity indefinitely: no error, no exit, nothing to check. That silent hang is arguably the worse half of the reported experience.

I have a small change ready that prints an actionable hint after ~30s of waiting when --app is set, naming CLI access as the likely cause. Held back from this PR pending the II conversation below — happy to open it as a follow-up if people want it.

We asked the II team whether the cli-disabled screen could grant access inline and continue to the delegation in the same request. Answer: no, independently granting access was a deliberate security decision — requiring an out-of-band act is anti-social-engineering, since otherwise a malicious local CLI could present the enable prompt at exactly the moment a user is primed to approve it. Reasonable, and we're not pushing back on it.

Two asks that the security rationale does not cover, still open with them:

  1. Report terminal states back to the callback — POST error=cli-disabled plus the nonce to the loopback URL. Grants nothing and reveals nothing new (the page already holds the nonce), but it would let us print a real error and exit non-zero instead of hanging. It also covers self-hosted --auth providers. This would need a small change on our side too: delegation is currently a required form field, so a delegation-less POST 422s.
  2. A deep link to the CLI access toggle — the error screen already has a "Manage your identity" button, so a settings route exists. If it can land on that specific setting, the docs and any future CLI hint could point at an exact URL instead of "open your identity settings".

Neither changes what's in this PR. Flagging in case anyone has an opinion on the hint, or wants to weigh in on the asks before we follow up with II.

A user followed the `--app nns.ic0.app` / `--app oisy.com` examples, hit
Internet Identity's "CLI access not enabled" screen, and concluded that
the NNS dapp and OISY don't support linking. They do — the identity just
needs CLI access enabled first, which the guide never mentioned.

Internet Identity gates a delegation for another app's domain behind a
per-identity "CLI access" setting. Linking without `--app`, where the
auth provider hands icp-cli its own account, is not gated.

Restructure the section so the working path leads: open with the plain
`icp identity link web <name>` form, then a `--app` subsection that
states the prerequisite before the examples rather than after them.
@marc0olo
marc0olo requested a review from a team as a code owner August 6, 2026 15:10
Copilot AI balanced review requested due to automatic review settings August 6, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Clarifies the prerequisite for linking an Internet Identity as a specific app.

Changes:

  • Leads with the setup-free linking flow.
  • Documents enabling per-browser, per-identity CLI access before using --app.
  • Relocates app-specific examples and alternativeOrigin guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/guides/managing-identities.md Outdated
`icp identity link web` rewrites `nns.internetcomputer.org` to
`nns.ic0.app` (web.rs:111-119), so the old warning that the former
"would give you a different principal" described an outcome users
cannot observe through this CLI. Keep the general `alternativeOrigin`
caution, which does hold for other apps, and document the NNS rewrite
as the alias it is.

Also note that the command waits for Enter before opening the browser,
which the previous wording skipped.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@marc0olo
marc0olo merged commit 1fecc1a into main Aug 6, 2026
34 checks passed
@marc0olo
marc0olo deleted the docs/identity-link-web-cli-access branch August 6, 2026 16:05
marc0olo added a commit that referenced this pull request Aug 6, 2026
…#695)

* docs: state the CLI access prerequisite for `identity link web --app`

A user followed the `--app nns.ic0.app` / `--app oisy.com` examples, hit
Internet Identity's "CLI access not enabled" screen, and concluded that
the NNS dapp and OISY don't support linking. They do — the identity just
needs CLI access enabled first, which the guide never mentioned.

Internet Identity gates a delegation for another app's domain behind a
per-identity "CLI access" setting. Linking without `--app`, where the
auth provider hands icp-cli its own account, is not gated.

Restructure the section so the working path leads: open with the plain
`icp identity link web <name>` form, then a `--app` subsection that
states the prerequisite before the examples rather than after them.

* docs: correct the `alternativeOrigin` note and the sign-in prompt

`icp identity link web` rewrites `nns.internetcomputer.org` to
`nns.ic0.app` (web.rs:111-119), so the old warning that the former
"would give you a different principal" described an outcome users
cannot observe through this CLI. Keep the general `alternativeOrigin`
caution, which does hold for other apps, and document the NNS rewrite
as the alias it is.

Also note that the command waits for Enter before opening the browser,
which the previous wording skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants