@@ -930,59 +930,48 @@ or failure.
930
930
1. Set |rootUrl|'s [=url/scheme=] to |configUrl|' s [=url/scheme=] .
931
931
1. Set |rootUrl|'s [=url/host=] to |configUrl|' s [=url/host=] 's [=host/registrable domain=] .
932
932
1. Set |rootUrl|'s
[=url/path=] to the
list «".well-known", "web-identity"».
933
- 1. Let |config|, |configInWellKnown| both be null.
933
+ 1. Let |config|, |discovery|, |accounts_url| and |login_url| be null.
934
934
1. Let |rpOrigin| be |globalObject|'s [=associated Document=]' s [=Document/origin=] .
935
- 1. If |rpOrigin| is not an [=opaque origin=] , and |rootUrl|'s [=url/host=] is equal
936
- to |rpOrigin|'s [=host/registrable domain=], and |rootUrl|' s [=url/scheme=] is
937
- equal to |rpOrigin|'s [=origin/scheme=] , set |configInWellKnown| to true.
935
+ 1. Let |wellKnownRequest| be a new [=/request=] as follows:
938
936
939
- Note: Because domain cookies are valid across an entire site, there is no privacy
940
- benefit from doing the well-known check if the RP and IDP are in the same site.
941
- 1. Otherwise:
942
- 1. Let |wellKnownRequest| be a new [=/request=] as follows:
943
-
944
- : [=request/URL=]
945
- :: |rootUrl|
946
- : [=request/client=]
947
- :: null
948
- : [=request/window=]
949
- :: "no-window"
950
- : [=request/service-workers mode=]
951
- :: "none"
952
- : [=request/destination=]
953
- :: "webidentity"
954
- : [=request/origin=]
955
- :: a unique [=opaque origin=]
956
- : [=request/header list=]
957
- :: a [=list=] containing a single [=header=] with [=header/name=] set to `Accept` and
958
- [=header/value=] set to `application/json`
959
- : [=request/referrer policy=]
960
- :: "no-referrer"
961
- : [=request/credentials mode=]
962
- :: "omit"
963
- : [=request/mode=]
964
- :: "no-cors"
965
-
966
- Issue: The spec is yet to be updated so that all
requests are created
967
- with [=request/mode=] set to "user-agent-no-cors". See the relevant
968
- [pull request] (https://github.com/whatwg/fetch/pull/1533) for details.
969
-
970
- 1. [=Fetch request=] with |wellKnownRequest| and |globalObject|, and with processResponseConsumeBody
971
- set to the following steps given a
response |response| and |responseBody|:
972
- 1. Let |json| be the result of [=extract the JSON fetch response=] from |response| and
973
- |responseBody|.
974
- 1. [=converted to an IDL value|Convert=] |json| to an {{IdentityProviderWellKnown}} ,
975
- |discovery|.
976
- 1. If one of the previous two steps threw an exception, or if the
977
- [=list/size=] of |discovery|["{{IdentityProviderWellKnown/provider_urls}}"] is
978
- greater than 1, set |configInWellKnown| to false.
979
-
980
- Issue: [relax] (https://github.com/fedidcg/FedCM/issues/333) the size of the
981
- provider_urls array.
982
-
983
- 1. Otherwise, set to |configInWellKnown| to true if
984
- |discovery|["{{IdentityProviderWellKnown/provider_urls}}"][0] [=string/is=] equal to
985
- |provider|'s {{IdentityProviderConfig/configURL}} , and to false otherwise.
937
+ : [=request/URL=]
938
+ :: |rootUrl|
939
+ : [=request/client=]
940
+ :: null
941
+ : [=request/window=]
942
+ :: "no-window"
943
+ : [=request/service-workers mode=]
944
+ :: "none"
945
+ : [=request/destination=]
946
+ :: "webidentity"
947
+ : [=request/origin=]
948
+ :: a unique [=opaque origin=]
949
+ : [=request/header list=]
950
+ :: a [=list=] containing a single [=header=] with [=header/name=] set to `Accept` and
951
+ [=header/value=] set to `application/json`
952
+ : [=request/referrer policy=]
953
+ :: "no-referrer"
954
+ : [=request/credentials mode=]
955
+ :: "omit"
956
+ : [=request/mode=]
957
+ :: "no-cors"
958
+
959
+ Issue: The spec is yet to be updated so that all
requests are created
960
+ with [=request/mode=] set to "user-agent-no-cors". See the relevant
961
+ [pull request] (https://github.com/whatwg/fetch/pull/1533) for details.
962
+
963
+ 1. [=Fetch request=] with |wellKnownRequest| and |globalObject|, and with processResponseConsumeBody
964
+ set to the following steps given a
response |response| and |responseBody|:
965
+ 1. Let |json| be the result of [=extract the JSON fetch response=] from |response| and
966
+ |responseBody|.
967
+ 1. Set |discovery| to the result of [=converted to an IDL value|converting=] |json|
968
+ to an {{IdentityProviderWellKnown}} .
969
+ 1. If one of the previous two steps threw an exception, or if the
970
+ [=list/size=] of |discovery|["{{IdentityProviderWellKnown/provider_urls}}"] is
971
+ greater than 1, set |discovery| to null.
972
+
973
+ Issue: [relax] (https://github.com/fedidcg/FedCM/issues/333) the size of the
974
+ provider_urls array.
986
975
987
976
1. Let |configRequest| be a new
request as follows:
988
977
@@ -1021,11 +1010,34 @@ or failure.
1021
1010
1. [=converted to an IDL value|Convert=] |json| to an {{IdentityProviderAPIConfig}} stored
1022
1011
in |config|.
1023
1012
1. If one of the previous two steps threw an exception, set |config| to failure.
1024
- 1. Set |config|.{{IdentityProviderAPIConfig/login_url}} to the result of [=computing
1025
- the manifest URL=] with |provider|, |config| and |globalObject|.
1026
- 1. If |config|.{{IdentityProviderAPIConfig/login_url}} is null, return failure.
1027
- 1. Wait for both |config| and |configInWellKnown| to be set.
1028
- 1. If |configInWellKnown| is true, return |config|. Otherwise, return failure.
1013
+ 1. Set |login_url| to the result of [=computing the manifest URL=] with |provider|,
1014
+ |config|.{{IdentityProviderAPIConfig/login_url}} and |globalObject|.
1015
+ 1. Set |accounts_url| to the result of [=computing the manifest URL=] with |provider|,
1016
+ |config|.{{IdentityProviderAPIConfig/accounts_endpoint}} and |globalObject|.
1017
+ 1. If |login_url| or |accounts_url| is failure, return failure.
1018
+ 1. Wait for both |config| and |discovery| to be set.
1019
+ 1. If |discovery| is null, return failure.
1020
+ 1. If |rpOrigin| is not an [=opaque origin=] , and |rootUrl|'s [=url/host=] is equal
1021
+ to |rpOrigin|'s [=host/registrable domain=], and |rootUrl|' s [=url/scheme=] is
1022
+ equal to |rpOrigin|'s [=origin/scheme=] , return |config|.
1023
+
1024
+ Note: Because domain cookies are valid across an entire site, there is no privacy
1025
+ benefit from doing the well-known check if the RP and IDP are in the same site.
1026
+ 1. If |discovery|.{{IdentityProviderWellKnown/accounts_endpoint}} and |discovery|.
1027
+ {{IdentityProviderWellKnown/login_url}} are set:
1028
+ 1. Let |well_known_accounts_url| be the result of [=computing the manifest URL=] with
1029
+ |provider|, |discovery|.{{IdentityProviderWellKnown/accounts_endpoint}}
1030
+ and |globalObject|.
1031
+ 1. Let |well_known_login_url| be the result of [=computing the manifest URL=] with |provider|,
1032
+ |discovery|.{{IdentityProviderWellKnown/login_url}} and |globalObject|.
1033
+ 1. If |well_known_accounts_url| is not [=url/equal=] to |accounts_url|, return failure.
1034
+ 1. If |well_known_login_url| is not [=url/equal=] to |login_url|, return failure.
1035
+ 1. Otherwise:
1036
+ 1. Let |allowed_config_url| be the result of [=computing the manifest URL=] with |provider|,
1037
+ |discovery|.{{IdentityProviderWellKnown/provider_urls}} [0] and |globalObject|.
1038
+ 1. If |allowed_config_url| is not [=url/equal=] to |configUrl|, return failure.
1039
+ 1. Return |config|.
1040
+
1029
1041
1030
1042
1031
1043
NOTE: a two-tier file system is used in order to prevent the [=IDP=] from easily determining the [=RP=]
@@ -1038,7 +1050,9 @@ path manipulation to fingerprint (for instance, by including the RP in the path)
1038
1050
1039
1051
1040
1052
dictionary IdentityProviderWellKnown {
1041
- required sequence provider_urls;
1053
+ sequence provider_urls;
1054
+ USVString accounts_endpoint;
1055
+ USVString login_url;
1042
1056
};
1043
1057
1044
1058
dictionary IdentityProviderIcon {
0 commit comments