Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .sources/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ motoko-core v2.4.0
cdk-rs ic-cdk v0.20.1 / ic-cdk-timers v1.0.0 / ic-cdk-executor v2.0.0 317f55c
candid 2025-12-18 # candid v0.10.20, didc v0.5.4 2e4a2cf
response-verification v3.1.0 18c5a37
internetidentity release-2026-07-17 8ffbe6f6
internetidentity release-2026-07-27 f94dde5f
2 changes: 1 addition & 1 deletion .sources/internetidentity
Submodule internetidentity updated 84 files
+17 −13 .github/workflows/canister-tests.yml
+14 −0 CLAUDE.md
+4 −3 Cargo.lock
+20 −8 scripts/dev-e2e-setup
+141 −3 src/canister_tests/src/api/internet_identity.rs
+8 −1 src/frontend/src/lib/components/settings/VerifiedEmailsPanel.svelte
+84 −0 src/frontend/src/lib/components/ui/SessionDurationSelect.svelte
+1 −0 src/frontend/src/lib/components/utils/error.ts
+130 −37 src/frontend/src/lib/components/wizards/auth/AuthWizard.svelte
+3 −5 src/frontend/src/lib/components/wizards/auth/views/PickAuthenticationMethod.svelte
+20 −14 src/frontend/src/lib/components/wizards/auth/views/SignInWithSso.svelte
+55 −0 src/frontend/src/lib/components/wizards/auth/views/SsoNormalLoginRequired.svelte
+3 −0 src/frontend/src/lib/components/wizards/verifiedEmail/VerifiedEmailWizard.svelte
+15 −3 src/frontend/src/lib/components/wizards/verifiedEmail/views/EnterAddress.svelte
+120 −23 src/frontend/src/lib/flows/authFlow.svelte.ts
+31 −14 src/frontend/src/lib/flows/authLastUsedFlow.svelte.ts
+87 −34 src/frontend/src/lib/generated/internet_identity_idl.js
+181 −39 src/frontend/src/lib/generated/internet_identity_types.d.ts
+1 −1 src/frontend/src/lib/legacy/flows/dappsExplorer/dapps.json
+1 −0 src/frontend/src/lib/stores/attributeConsent.store.ts
+3 −2 src/frontend/src/lib/stores/authentication.store.ts
+45 −1 src/frontend/src/lib/stores/authorization.store.test.ts
+44 −5 src/frontend/src/lib/stores/authorization.store.ts
+107 −82 src/frontend/src/lib/stores/channelHandlers/attributes.ts
+39 −5 src/frontend/src/lib/stores/channelHandlers/delegation.ts
+4 −0 src/frontend/src/lib/utils/auth-handoff.ts
+99 −2 src/frontend/src/lib/utils/authentication/jwt.ts
+1 −2 src/frontend/src/lib/utils/iiConnection.test.ts
+117 −0 src/frontend/src/lib/utils/sessionDuration.test.ts
+91 −0 src/frontend/src/lib/utils/sessionDuration.ts
+45 −14 src/frontend/src/lib/utils/ssoDiscovery.test.ts
+40 −27 src/frontend/src/lib/utils/ssoDiscovery.ts
+3 −1 src/frontend/src/routes/(new-styling)/authorize/+layout.svelte
+207 −21 src/frontend/src/routes/(new-styling)/authorize/+page.svelte
+14 −6 src/frontend/src/routes/(new-styling)/authorize/+page.ts
+23 −5 src/frontend/src/routes/(new-styling)/authorize/views/AttributeConsentView.svelte
+8 −1 src/frontend/src/routes/(new-styling)/authorize/views/AuthWizardView.svelte
+80 −12 src/frontend/src/routes/(new-styling)/authorize/views/ContinueView.svelte
+6 −0 src/frontend/src/routes/(new-styling)/manage/(authenticated)/+layout.svelte
+7 −0 src/frontend/src/routes/(new-styling)/manage/(authenticated)/shareable-info/+page.svelte
+11 −65 src/frontend/src/routes/(new-styling)/mcp/views/McpAuthorizeView.svelte
+1 −2 src/frontend/src/routes/vc-flow/index/+page.svelte
+13 −1 src/frontend/tests/e2e-playwright/fixtures/manageAccessPage.ts
+67 −9 src/frontend/tests/e2e-playwright/fixtures/sso.ts
+7 −7 src/frontend/tests/e2e-playwright/routes/authorize/account.spec.ts
+175 −1 src/frontend/tests/e2e-playwright/routes/authorize/consent.spec.ts
+2 −2 src/frontend/tests/e2e-playwright/routes/authorize/continue.spec.ts
+3 −3 src/frontend/tests/e2e-playwright/routes/authorize/session-delegation.spec.ts
+768 −3 src/frontend/tests/e2e-playwright/routes/authorize/sso.spec.ts
+3 −0 src/internet_identity/Cargo.toml
+69 −18 src/internet_identity/internet_identity.did
+2 −0 src/internet_identity/src/anchor_management.rs
+13 −28 src/internet_identity/src/anchor_management/registration/registration_flow_v2.rs
+115 −36 src/internet_identity/src/attributes.rs
+74 −28 src/internet_identity/src/email_inbound/smtp.rs
+10 −0 src/internet_identity/src/http/metrics.rs
+196 −39 src/internet_identity/src/main.rs
+61 −28 src/internet_identity/src/openid.rs
+2 −2 src/internet_identity/src/openid/configured.rs
+401 −164 src/internet_identity/src/openid/sso.rs
+369 −0 src/internet_identity/src/openid/sso_bundle.rs
+599 −0 src/internet_identity/src/openid/sso_gating.rs
+62 −25 src/internet_identity/src/openid/verify.rs
+6 −11 src/internet_identity/src/state.rs
+128 −1 src/internet_identity/src/storage.rs
+3 −0 src/internet_identity/src/storage/anchor.rs
+1 −0 src/internet_identity/src/storage/anchor/tests.rs
+1 −0 src/internet_identity/src/storage/storable.rs
+21 −4 src/internet_identity/src/storage/storable/openid_credential.rs
+95 −0 src/internet_identity/src/storage/storable/sso_stable_id_key.rs
+5 −10 src/internet_identity/src/storage/storable/storable_persistent_state.rs
+65 −0 src/internet_identity/src/storage/tests.rs
+21 −13 src/internet_identity/tests/integration/attributes.rs
+16 −114 src/internet_identity/tests/integration/config/sso_discovery.rs
+60 −2 src/internet_identity/tests/integration/mcp.rs
+1,361 −1 src/internet_identity/tests/integration/openid.rs
+1 −0 src/internet_identity/tests/integration/v2_api/authn_method_test_helpers.rs
+23 −20 src/internet_identity_interface/src/internet_identity/types.rs
+8 −1 src/internet_identity_interface/src/internet_identity/types/api_v2.rs
+9 −10 src/internet_identity_interface/src/internet_identity/types/attributes.rs
+57 −1 src/internet_identity_interface/src/internet_identity/types/openid.rs
+8 −16 src/test_openid_provider/README.md
+68 −8 src/test_openid_provider/index.js
+4 −1 vite.config.ts
87 changes: 69 additions & 18 deletions public/references/internet-identity.did
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,12 @@ type InternetIdentityInit = record {
new_flow_origins : opt vec text;
// Configurations for OpenID clients
openid_configs : opt vec OpenIdConfig;
// Allowlist of domains that may be used as discoverable SSO providers.
// When set, fully replaces the built-in defaults. When unset, falls back
// to `dfinity.org` (production) or `beta.dfinity.org` (everything else),
// keyed off `is_production`.
sso_discoverable_domains : opt vec text;
// Deploy flag opening the SSO discovery domain gate to any domain. When
// `true`, `sso_discoverable_domains` (and its defaults) no longer restrict
// which domains may be discovered as SSO providers. Does not relax the
// strict-`https` requirement: serving discovery over plain `http` still
// requires the host to be on the explicit `sso_discoverable_domains` list.
sso_allow_any_domain : opt bool;
// Deploy flag relaxing the `https` requirement for SSO discovery outcalls to
// loopback hosts (`localhost` / `127.0.0.1`) so e2e tests can point at local
// mock IdPs served over plain `http`. Unset / `false` (the default) require
// `https` for every discovery host. Never enable in production — non-loopback
// hosts always require `https` regardless.
sso_allow_insecure_discovery : opt bool;
// One-shot backfill of the `sso_domain` / `sso_name` fields on stored
// OpenID credentials. When set, a batched timer-driven migration stamps
// every stored credential whose (iss, aud) matches an entry and whose
Expand Down Expand Up @@ -488,20 +483,28 @@ type OpenIdConfig = record {
// from the domain's two-hop discovery documents, on demand and cached.
type SsoDiscovery = record {
discovery_domain : text;
// The org's primary OIDC client.
client_id : text;
issuer : text;
authorization_endpoint : text;
scopes : vec text;
name : opt text;
// Client the target origin runs its ceremony against; `null` when denied.
resolved_client_id : opt text;
};

// State of a domain's SSO discovery, read by `get_sso_discovery`. A failed
// fetch isn't a distinct state — it reads as `Pending` and the frontend times
// out — so the states are resolved, in flight, or not allowed.
type SsoDiscoveryState = variant {
// Status of a domain's SSO discovery, read by `get_sso_discovery_status`. A
// failed fetch isn't a distinct status — it reads as `Pending` and the frontend
// times out — so the statuses are: resolved, or in flight.
type SsoDiscoveryStatus = variant {
Resolved : SsoDiscovery;
Pending;
NotAllowed;
};

// Request for `get_sso_discovery_status`.
type GetSsoDiscoveryStatusRequest = record {
org_domain : text;
target_app_origin : opt FrontendHostname;
};

type OpenIdCredentialKey = record { Iss; Sub; Aud };
Expand Down Expand Up @@ -558,6 +561,40 @@ type OpenIdPrepareDelegationResponse = record {
anchor_number : UserNumber;
};

// Request for `sso_prepare_delegation`.
type SsoPrepareDelegationRequest = record {
jwt : JWT;
salt : Salt;
session_key : SessionKey;
org_domain : text;
target_app_origin : FrontendHostname;
};

// Request for `sso_get_delegation`.
type SsoGetDelegationRequest = record {
jwt : JWT;
salt : Salt;
session_key : SessionKey;
expiration : Timestamp;
org_domain : text;
target_app_origin : FrontendHostname;
sso_attr_bundle : blob;
};

// Response of `sso_prepare_delegation`.
type SsoPrepareDelegationResponse = record {
user_key : UserKey;
expiration : Timestamp;
anchor_number : UserNumber;
sso_attr_bundle : blob;
};

// Response of `sso_get_delegation`.
type SsoGetDelegationResponse = record {
signed_delegation : SignedDelegation;
sso_attr_bundle_signature : blob;
};

// Email-recovery types
// ====================
// See `docs/ongoing/email-recovery.md` for the full design. Covers
Expand Down Expand Up @@ -902,6 +939,8 @@ type OpenIDRegFinishArg = record {
// SSO discovery domain the JWT was obtained through, or null for a direct
// provider (Google / Microsoft / Apple). Selects the JWK source.
discovery_domain : opt text;
// Target dapp origin, set only for a first gated SSO login.
origin : opt text;
};

// Extra information about registration status for new authentication methods
Expand Down Expand Up @@ -1267,6 +1306,9 @@ type IdRegFinishError = variant {
InvalidAuthnMethod : text;
// Error while persisting the new identity.
StorageError : text;
// A gated SSO login for a non-`sub` org: the user must first sign in
// through the org's primary client.
SsoNormalLoginRequired;
};

type AccountInfo = record {
Expand Down Expand Up @@ -1667,11 +1709,20 @@ service : (opt InternetIdentityInit) -> {
openid_get_delegation : (JWT, Salt, SessionKey, Timestamp, opt text) -> (variant { Ok : SignedDelegation; Pending; Err : OpenIdDelegationError }) query;

// SSO discovery for the sign-in initiation flow. The frontend polls
// `get_sso_discovery` (query) and, while it reads `Pending`, drives the
// `get_sso_discovery_status` (query) and, while it reads `Pending`, drives the
// on-demand two-hop discovery fetch with `discover_sso` (update); once the
// fetch completes the query returns `Resolved` with the config.
//
// The optional second argument is the target dapp origin; when supplied,
// `resolved_client_id` reports the client that origin must use (`null` = denied).
discover_sso : (text) -> ();
get_sso_discovery : (text) -> (SsoDiscoveryState) query;
get_sso_discovery_status : (GetSsoDiscoveryStatusRequest) -> (SsoDiscoveryStatus) query;

// SSO sign-in path. Mints a delegation only if the JWT's `aud` matches the
// client the target origin resolves to. `Pending` means the discovery/JWKS
// cache is cold — re-call to drive the fetch.
sso_prepare_delegation : (SsoPrepareDelegationRequest) -> (variant { Ok : SsoPrepareDelegationResponse; Pending; Err : OpenIdDelegationError });
sso_get_delegation : (SsoGetDelegationRequest) -> (variant { Ok : SsoGetDelegationResponse; Pending; Err : OpenIdDelegationError }) query;

// ===================================================================
// Email-challenge protocol (shared inbound-DKIM primitive)
Expand Down
Loading