Skip to content

docs: use the Motoko identity-attributes library for II attribute verification#286

Open
sea-snake wants to merge 8 commits into
mainfrom
docs/ii-attributes-motoko-library
Open

docs: use the Motoko identity-attributes library for II attribute verification#286
sea-snake wants to merge 8 commits into
mainfrom
docs/ii-attributes-motoko-library

Conversation

@sea-snake
Copy link
Copy Markdown
Contributor

Summary

Reframes the Internet Identity attribute flow in the authentication guide around the two-method protocol (_internet_identity_sign_in_start / _internet_identity_sign_in_finish): the mo:identity-attributes mixin provides it in Motoko, hand-written in Rust (no Rust library yet). One frontend works against either backend.

Changes

  • Frontend: nonce, sign-in, and requestAttributes run in parallel (nonce passed as a promise); requests name + verified_email; checks the { ok }/{ err } result.
  • Motoko tab: include IdentityAttributes({ onVerified }) plus mops.toml and icp.yaml env vars (trusted_attribute_signers, frontend_origins, optional trusted_sso_domains).
  • Rust tab: hand-implements the two methods with the full manual verification, mirroring the library.
  • Storing-the-nonce tip, common-mistakes entry, and the upstream footer updated (adds dfinity/motoko-identity-attributes).

Verification

  • The edited internet-identity.mdx compiles cleanly via @mdx-js/mdx.
  • Full astro build deferred to CI (the local sandbox lacked the .sources submodules; all sandbox build errors were on other pages, none on this file).

…ification

Reframe the Internet Identity attribute flow around the two-method protocol
(_internet_identity_sign_in_start / _internet_identity_sign_in_finish): the
mo:identity-attributes mixin provides it in Motoko, hand-written in Rust so a
single frontend works against either backend. The frontend now runs nonce,
sign-in, and the attribute request in parallel and requests name and
verified_email. Adds frontend_origins to the icp.yaml env vars and updates the
storing-the-nonce guidance and common-mistakes entry.
@sea-snake sea-snake requested review from a team as code owners June 3, 2026 15:53
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

🤖 Preview build failed.

sea-snake added 7 commits June 3, 2026 18:09
…xample

verified_attributes already rejects callers without a trusted II bundle, so the inline anonymous check duplicated the Reject-anonymous-callers section. Mirrors the mo:identity-attributes mixin, which has no separate check.
With the fixed _internet_identity_sign_in_start/finish methods the nonce binds one sign-in handshake; it is not tied to a named action or user. Reword the replay-protection notes accordingly.
Drop the nonce-keying rationale, the raw_rand location comment (the call is right there), and verbose upgrade/heap wording. Keep only purposeful comments.
It was a shared tip outside the Tabs block, so it rendered under Motoko too, even though nonce storage is a Rust-only concern (the mo:identity-attributes library handles it). Now lives inside the Rust tab.
…storage note

Use the method-call form from the mo:identity-attributes README instead of Map.add/Map.get, and remove the storing-the-nonce note.
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.

1 participant