@@ -451,7 +451,7 @@ This specification introduces a new type of {{Credential}}, called an {{Identity
451
451
:: The {{Credential/id}} 's attribute getter returns the empty string.
452
452
: <b> {{IdentityCredential/token}} </b>
453
453
:: The {{IdentityCredential/token}} 's attribute getter returns the value it is set to.
454
- It represents the minted {{IdentityProviderToken /token}} provided by the [=IDP=] .
454
+ It represents the minted {{IdentityAssertionResponse /token}} provided by the [=IDP=] .
455
455
: <b> {{IdentityCredential/isAutoSelected}} </b>
456
456
:: {{IdentityCredential/isAutoSelected}} 's attribute getter returns the value it is
457
457
set to. It represents whether the user's identity credential was automatically selected when
@@ -673,8 +673,8 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
673
673
:: The {{id_assertion_endpoint_request/client_id}} provided to the [=RP=] out of band by the [=IDP=]
674
674
: <b> {{IdentityProviderRequestOptions/nonce}} </b>
675
675
:: A random number of the choice of the [=RP=] . It is generally used to associate a client
676
- session with a {{IdentityProviderToken /token}} and to mitigate replay attacks. Therefore, this value should have
677
- sufficient entropy such that it would be hard to guess.
676
+ session with a {{IdentityAssertionResponse /token}} and to mitigate replay attacks.
677
+ Therefore, this value should have sufficient entropy such that it would be hard to guess.
678
678
: <b> {{IdentityProviderRequestOptions/loginHint}} </b>
679
679
:: A string representing the login hint corresponding to an account which the RP wants the user
680
680
agent to show to the user. If provided, the user agent will not show accounts which do not
@@ -1261,21 +1261,43 @@ To <dfn>fetch an identity assertion</dfn> given a {{USVString}}
1261
1261
set to the following steps given a <a spec=fetch for=/>response</a> |response| and |responseBody|:
1262
1262
1. Let |json| be the result of [=extract the JSON fetch response=] from |response| and
1263
1263
|responseBody|.
1264
- 1. [=converted to an IDL value|Convert=] |json| to an {{IdentityProviderToken }} , |token|.
1264
+ 1. [=converted to an IDL value|Convert=] |json| to an {{IdentityAssertionResponse }} , |token|.
1265
1265
1. If one of the previous two steps threw an exception, set |credential| to failure
1266
1266
and return.
1267
+ 1. If neither {{IdentityAssertionResponse/token}} nor
1268
+ {{IdentityAssertionResponse/continue_on}} was specified, set |credential| to failure
1269
+ and return.
1270
+ 1. If {{IdentityAssertionResponse/token}} was specified, let |tokenString|
1271
+ be |token|'s {{IdentityAssertionResponse/token}} .
1272
+ 1. Otherwise, run these steps [=in parallel=] :
1273
+ 1. Let |continueOnUrl| be the result of running [=parse url=] with |token|'s
1274
+ {{IdentityAssertionResponse/continue_on}} and |globalObject|.
1275
+ 1. If |continueOnUrl| is failure, set |credential| to failure and return.
1276
+ 1. If |continueOnUrl| is not [=same origin=] with |tokenUrl|, set |credential|
1277
+ to failure and return.
1278
+ 1. Let |tokenPair| be the result of [=show a continuation dialog=] with |continueOnUrl|.
1279
+ 1. If |tokenPair| is failure, set |credential| to failure and return.
1280
+ 1. Let |tokenString| be the first entry of |tokenPair|.
1281
+ 1. If the second entry of |tokenPair| is not null, set |accountId| to that second entry.
1282
+ 1. Wait for |tokenString| or |credential| to be set.
1283
+ 1. If |credential| is set:
1284
+ 1. Assert that |credential| is set to failure.
1285
+ 1. Return |credential|.
1286
+ 1. [=Create a connection between the RP and the IdP account=] with |provider|, |accountId|, and
1287
+ |globalObject|.
1267
1288
1. Let |credential| be a new {{IdentityCredential}} given |globalObject|'s
1268
1289
<a for="global object">realm</a> .
1269
- 1. Set |credential|'s {{IdentityCredential/token}} to |token |.
1290
+ 1. Set |credential|'s {{IdentityCredential/token}} to |tokenString |.
1270
1291
1. Set |credential|'s {{IdentityCredential/isAutoSelected}} to
1271
1292
|isAutoSelected|.
1272
1293
1. Wait for |credential| to be set.
1273
1294
1. Return |credential|.
1274
1295
</div>
1275
1296
1276
1297
<xmp class="idl">
1277
- dictionary IdentityProviderToken {
1278
- required USVString token;
1298
+ dictionary IdentityAssertionResponse {
1299
+ USVString token;
1300
+ USVString continue_on;
1279
1301
};
1280
1302
</xmp>
1281
1303
@@ -1318,8 +1340,6 @@ an {{IdentityProviderAPIConfig}} |config|, an {{IdentityProviderRequestOptions}}
1318
1340
{{IdentityCredentialRequestOptions/context}} and |options|'s
1319
1341
{{IdentityCredentialRequestOptions/mode}} to customize the dialog shown.
1320
1342
1. If the user does not grant permission, return false.
1321
- 1. [=Create a connection between the RP and the IdP account=] with |provider|, |account|, and
1322
- |globalObject|.
1323
1343
1. Return true.
1324
1344
</div>
1325
1345
@@ -1483,6 +1503,32 @@ success or failure.
1483
1503
1. Otherwise, return failure.
1484
1504
</div>
1485
1505
1506
+ <div algorithm>
1507
+ To <dfn>show a continuation dialog</dfn> given a |continueOnUrl|, run the
1508
+ following steps. This returns a failure or a tuple (string, string?) (a token
1509
+ and an optional account ID).
1510
+ 1. Assert: these steps are running [=in parallel=] .
1511
+ 1. [=Create a fresh top-level traversable=] with |continueOnUrl|.
1512
+ 1. The user agent MAY [=set up browsing context features=] or otherwise
1513
+ affect the presentation of this traversable in an implementation-defined
1514
+ way.
1515
+ 1. Wait for the first occurence of one of the following conditions:
1516
+ * The user closes the browsing context: return failure.
1517
+ * {{IdentityProvider}} .{{IdentityProvider/close}} is called in the
1518
+ context of this new traversable:
1519
+ 1. Close the traversable.
1520
+ 1. Return failure.
1521
+ * {{IdentityProvider}} .{{IdentityProvider/resolve()}} is called in
1522
+ the context of this new traversable.
1523
+ 1. Close the traversable.
1524
+ 1. Let |token| be the token that was passed to that resolve call.
1525
+ 1. If {{IdentityResolveOptions/accountId}} was specified in the
1526
+ resolve call, let |accountId| be that account ID.
1527
+ 1. Otherwise, let |accountId| be null.
1528
+ 1. Return (|token|, |accountId|).
1529
+
1530
+ </div>
1531
+
1486
1532
<div algorithm>
1487
1533
To <dfn>fetch the config file and show an IDP login dialog</dfn> given an
1488
1534
{{IdentityProviderConfig}} |provider|, and a |globalObject|, run the following
@@ -1511,8 +1557,13 @@ This specification introduces the {{IdentityUserInfo}} dictionary as well as the
1511
1557
USVString picture;
1512
1558
};
1513
1559
1560
+ dictionary IdentityResolveOptions {
1561
+ USVString accountId;
1562
+ };
1563
+
1514
1564
[Exposed=Window, SecureContext] interface IdentityProvider {
1515
1565
static undefined close();
1566
+ static undefined resolve(DOMString token, optional IdentityResolveOptions options = {});
1516
1567
static Promise<sequence<IdentityUserInfo>> getUserInfo(IdentityProviderConfig config);
1517
1568
};
1518
1569
</pre>
@@ -1978,22 +2029,26 @@ the <a http-header>Origin</a> header value is represented by the
1978
2029
[=IDP=] -specific, the [=user agent=] cannot perform this check.
1979
2030
</div>
1980
2031
1981
- The response body must be a JSON object that can be [=converted to an IDL value|converted=] to an {{IdentityProviderToken }} without an exception.
2032
+ The response body must be a JSON object that can be [=converted to an IDL value|converted=] to an {{IdentityAssertionResponse }} without an exception.
1982
2033
1983
- Every {{IdentityProviderToken }} is expected to have members with the following semantics:
2034
+ Every {{IdentityAssertionResponse }} is expected to have members with the following semantics:
1984
2035
1985
- <dl dfn-type="dict-member" dfn-for="IdentityProviderToken ">
2036
+ <dl dfn-type="dict-member" dfn-for="IdentityAssertionResponse ">
1986
2037
: <dfn>token</dfn>
1987
2038
:: The resulting token.
2039
+ : <dfn>continue_on</dfn>
2040
+ :: A URL that the user agent will open in a popup to finish the authentication process.
1988
2041
</dl>
1989
2042
1990
- The content of the {{IdentityProviderToken/token}} is opaque to the user agent and can contain
2043
+ Only one of `token` and `continue_on` should be specified.
2044
+
2045
+ The content of the {{IdentityAssertionResponse/token}} is opaque to the user agent and can contain
1991
2046
anything that the [=IDP=] would like to pass to the
1992
2047
[=RP=] to facilitate the login. For this reason the [=RP=]
1993
- is expected to be the party responsible for validating the {{IdentityProviderToken/token}} passed
1994
- along from the [=IDP=] using the appropriate token validation
1995
- algorithms defined. One example of how this might be done is defined
1996
- in [[OIDC-Connect-Core#IDTokenValidation]] .
2048
+ is expected to be the party responsible for validating the
2049
+ {{IdentityAssertionResponse/token}} passed along from the [=IDP=] using the
2050
+ appropriate token validation algorithms defined. One example of how this might
2051
+ be done is defined in [[OIDC-Connect-Core#IDTokenValidation]] .
1997
2052
1998
2053
NOTE: For [=IDPs=] , it is worth considering how
1999
2054
[portable] (https://github.com/fedidcg/FedCM/issues/314) accounts are.
0 commit comments