chromium/third_party/blink/renderer/modules/credentialmanagement/identity_credential.idl

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://fedidcg.github.io/FedCM/#browser-api-identity-credential-interface

dictionary IdentityCredentialDisconnectOptions : IdentityProviderConfig {
  required USVString accountHint;
};

[
    Exposed=Window,
    SecureContext,
    RuntimeEnabled=FedCm
] interface IdentityCredential : Credential {
    // https://fedidcg.github.io/FedCM/#dom-identitycredential-token
    readonly attribute USVString token;

    // Whether an account was automatically selected in the FedCM flow.
    [RuntimeEnabled=FedCmAutoSelectedFlag]
    readonly attribute boolean isAutoSelected;

    // The config URL of the selected identity provider.
    [RuntimeEnabled=FedCmMultipleIdentityProviders] readonly attribute USVString configURL;

    // https://github.com/fedidcg/FedCM/pull/515
    [RuntimeEnabled=FedCmDisconnect, CallWith=ScriptState, RaisesException, MeasureAs=FedCmDisconnect] static Promise<undefined> disconnect(optional IdentityCredentialDisconnectOptions options = {});

};