1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://fedidcg.github.io/FedCM
11 [Exposed=Window, SecureContext,
12 Pref="dom.security.credentialmanagement.identity.enabled"]
13 interface IdentityCredential : Credential {
14 readonly attribute USVString? token;
16 static Promise<undefined> logoutRPs(sequence<IdentityCredentialLogoutRPsRequest> logoutRequests);
19 dictionary IdentityCredentialRequestOptions {
20 sequence<IdentityProviderConfig> providers;
23 [GenerateConversionToJS]
24 dictionary IdentityProviderConfig {
25 required UTF8String configURL;
26 required USVString clientId;
30 // https://fedidcg.github.io/FedCM/#dictdef-identityproviderwellknown
32 dictionary IdentityProviderWellKnown {
33 required sequence<UTF8String> provider_urls;
36 // https://fedidcg.github.io/FedCM/#dictdef-identityprovidericon
37 dictionary IdentityProviderIcon {
38 required USVString url;
42 // https://fedidcg.github.io/FedCM/#dictdef-identityproviderbranding
43 dictionary IdentityProviderBranding {
44 USVString background_color;
46 sequence<IdentityProviderIcon> icons;
50 // https://fedidcg.github.io/FedCM/#dictdef-identityproviderapiconfig
51 [GenerateInit, GenerateConversionToJS]
52 dictionary IdentityProviderAPIConfig {
53 required UTF8String accounts_endpoint;
54 required UTF8String client_metadata_endpoint;
55 required UTF8String id_assertion_endpoint;
56 IdentityProviderBranding branding;
60 // https://fedidcg.github.io/FedCM/#dictdef-identityprovideraccount
61 dictionary IdentityProviderAccount {
62 required USVString id;
63 required USVString name;
64 required USVString email;
67 sequence<USVString> approved_clients;
70 // https://fedidcg.github.io/FedCM/#dictdef-identityprovideraccountlist
71 [GenerateInit, GenerateConversionToJS]
72 dictionary IdentityProviderAccountList {
73 sequence<IdentityProviderAccount> accounts;
76 // https://fedidcg.github.io/FedCM/#dictdef-identityproviderclientmetadata
77 [GenerateInit, GenerateConversionToJS]
78 dictionary IdentityProviderClientMetadata {
79 USVString privacy_policy_url;
80 USVString terms_of_service_url;
83 // https://fedidcg.github.io/FedCM/#dictdef-identityprovidertoken
85 dictionary IdentityProviderToken {
86 required USVString token;
89 // https://fedidcg.github.io/FedCM/#dictdef-identitycredentiallogoutrpsrequest
90 dictionary IdentityCredentialLogoutRPsRequest {
91 required UTF8String url;
92 required UTF8String accountId;