@@ -394,3 +394,108 @@ To use the Use Other Account API:
394394 }
395395}
396396```
397+
398+ ### Continuation API
399+ This API lets the IdP request that the authorization flow should continue
400+ in a popup window that is controlled by the IdP. This can be used to request
401+ additional permission, to ask a user to confirm their account details, or
402+ for a variety of other use cases.
403+
404+ To use this feature:
405+ * Enable the experimental feature `FedCmAuthz` in chrome://flags
406+ * Return a "continue_on" field with a URL instead of a token
407+ from the ID assertion endpoint. For example:
408+ ```js
409+ {
410+ "continue_on": "https://idp.example/finish_login?account_id=123"
411+ }
412+ ```
413+ * When the authorization flow finishes, call `IdentityProvider.resolve` to close the
414+ popup and provide the token that will be passed to the RP:
415+ ```js
416+ IdentityProvider.resolve("this is the token");
417+ ```
418+ * If the account ID has changed (for example, if the popup provided a "Switch
419+ User" function), you can specify it in a second parameter:
420+ ```js
421+ IdentityProvider.resolve("this is the token", {accountId: "123"});
422+ ```
423+ * If the user cancels the login flow, call `IdentityProvider.close` to close
424+ the popup and reject the promise that was returned from `navigator.credentials.get`:
425+ ```js
426+ IdentityProvider.close();
427+ ```
428+
429+ ### Parameters API
430+ This feature lets RPs specify additional key/value pairs that will get sent
431+ to the ID assertion endpoint.
432+
433+ To use this feature:
434+ * Enable the experimental feature `FedCmAuthz` in chrome://flags
435+ * Add a `params` field to the `navigator.credentials.get` call:
436+ ```js
437+ navigator.credentials.get({
438+ identity: {
439+ providers: [{
440+ configURL: "https://idp.example/config.json",
441+ clientId: "123",
442+ nonce: nonce,
443+ params: {
444+ "key": "value",
445+ "anything_goes": "yes",
446+ "really": "yes",
447+ "scopes": "calendar.readonly",
448+ "dpop": "something",
449+ "moar": "sure",
450+ }
451+ }],
452+ }
453+ });
454+ ```
455+ * These key/value pairs will be sent as-is in the ID assertion request:
456+ `account_id=123&key=value&anything_goes=yes&really=yes&scopes=calendar.readonly&dpop=something&moar=sure&...`
457+
458+
459+ ### Multiple configURLs
460+ This feature lets you have multiple different config files under the same
461+ eTLD+1 as long as they all have the same accounts_endpoint. This can be
462+ useful to specify different branding or different ID assertion endpoints.
463+
464+ To use this feature:
465+ * Enable the experimental feature `FedCmAuthz` in chrome://flags
466+ * Add the login_url and accounts_endpoint to the .well-known/web-identity
467+ file:
468+ ```js
469+ {
470+ "provider_urls": [
471+ // keep this unchanged
472+ ],
473+ "accounts_endpoint": "https://fedcm.idp.example/accounts",
474+ "login_url": "https://fedcm.idp.example/login.html"
475+ }
476+ ```
477+
478+ ### Account labels
479+ The account labels API lets IdPs give a list of labels to an account and
480+ lets different config files specify a filter for those labels.
481+
482+ To use the API:
483+ * Enable the experimental feature `FedCmAuthz` in chrome://flags
484+ * Add a `labels` field to accounts in the account endpoint:
485+ ```js
486+ {
487+ "name": "John Smith",
488+ //...
489+ "labels": ["label1"]
490+ }
491+ ```
492+ * Add the desired label to the config file:
493+ ```js
494+ {
495+ "accounts_endpoint": "...",
496+ // ...
497+ "accounts": {
498+ "include": "label1"
499+ }
500+ }
501+ ```
0 commit comments