@@ -1348,7 +1348,7 @@ mod openid_api {
13481348 ) -> OpenIdResult < IdRegFinishResult , IdRegFinishError > {
13491349 // Canonicalize the untrusted discovery domain at the boundary so both
13501350 // verification and the credential stored from `arg` see the same value.
1351- arg. discovery_domain = openid:: canonical_discovery_domain ( arg. discovery_domain ) ;
1351+ arg. discovery_domain = openid:: canonical_discovery_domain_opt ( arg. discovery_domain ) ;
13521352 // Verify the JWT (driving the SSO discovery/JWKS fetches it may need)
13531353 // up front: a cold or evicted cache surfaces as the `Pending` retry arm
13541354 // instead of a terminal registration error. The verified credential is
@@ -1375,7 +1375,7 @@ mod openid_api {
13751375 salt : [ u8 ; 32 ] ,
13761376 discovery_domain : Option < String > ,
13771377 ) -> OpenIdResult < ( ) , OpenIdCredentialAddError > {
1378- let discovery_domain = openid:: canonical_discovery_domain ( discovery_domain) ;
1378+ let discovery_domain = openid:: canonical_discovery_domain_opt ( discovery_domain) ;
13791379 openid:: prefetch_sso ( discovery_domain. as_deref ( ) ) ;
13801380 let openid_credential = match openid:: verify_jwt ( & jwt, & salt, discovery_domain. as_deref ( ) ) {
13811381 Ok ( openid:: Cached :: Ready ( credential) ) => credential,
@@ -1428,7 +1428,7 @@ mod openid_api {
14281428 // read the result. A cold cache reads `Pending`; the frontend polls
14291429 // `openid_get_delegation` and re-calls this until the delegation is
14301430 // ready.
1431- let discovery_domain = openid:: canonical_discovery_domain ( discovery_domain) ;
1431+ let discovery_domain = openid:: canonical_discovery_domain_opt ( discovery_domain) ;
14321432 openid:: prefetch_sso ( discovery_domain. as_deref ( ) ) ;
14331433 let openid_credential = match openid:: verify_jwt ( & jwt, & salt, discovery_domain. as_deref ( ) ) {
14341434 Ok ( openid:: Cached :: Ready ( credential) ) => credential,
@@ -1490,7 +1490,7 @@ mod openid_api {
14901490 // caches. A `Pending` means discovery/JWKS isn't cached yet — the
14911491 // frontend re-calls `openid_prepare_delegation` (an update, which drives
14921492 // the fetch) and polls this again.
1493- let discovery_domain = openid:: canonical_discovery_domain ( discovery_domain) ;
1493+ let discovery_domain = openid:: canonical_discovery_domain_opt ( discovery_domain) ;
14941494 let openid_credential = match openid:: verify_jwt ( & jwt, & salt, discovery_domain. as_deref ( ) ) {
14951495 Ok ( openid:: Cached :: Ready ( credential) ) => credential,
14961496 Ok ( openid:: Cached :: Pending ) => return OpenIdResult :: Pending ,
@@ -1517,7 +1517,7 @@ mod openid_api {
15171517 /// query until it returns `Resolved`.
15181518 #[ update]
15191519 fn discover_sso ( domain : String ) {
1520- openid:: discover_sso ( & domain)
1520+ openid:: discover_sso ( & openid :: canonical_discovery_domain ( & domain) )
15211521 }
15221522
15231523 /// Read the state of `domain`'s SSO discovery: `Resolved` with the config,
@@ -1526,7 +1526,7 @@ mod openid_api {
15261526 fn get_sso_discovery (
15271527 domain : String ,
15281528 ) -> internet_identity_interface:: internet_identity:: types:: SsoDiscoveryState {
1529- openid:: get_sso_discovery ( & domain)
1529+ openid:: get_sso_discovery ( & openid :: canonical_discovery_domain ( & domain) )
15301530 }
15311531}
15321532
0 commit comments