// 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. dictionary IdentityUserInfo { USVString email; USVString name; USVString givenName; USVString picture; }; enum ResolveRedirectRequestMethod { "GET", "POST" }; dictionary IdentityResolveOptions { USVString accountId; [RuntimeEnabled=FedCmNavigationInterception] boolean redirect = false; [RuntimeEnabled=FedCmNavigationInterception] ResolveRedirectRequestMethod method = "GET"; [RuntimeEnabled=FedCmNavigationInterception] USVString body = ""; }; dictionary IdentityProviderToken { required USVString token; }; // https://fedidcg.github.io/FedCM/#identityprovider [ Exposed=Window, SecureContext, RuntimeEnabled=FedCm ] interface IdentityProvider { // Allows an IDP to request user info from its own iframe embeded on an RP. [CallWith=ScriptState, RaisesException, MeasureAs=FedCmUserInfo] static Promise> getUserInfo(IdentityProviderConfig config); [CallWith=ScriptState] static void close(); [RuntimeEnabled=FedCmIdPRegistration, CallWith=ScriptState, ImplementedAs=registerIdentityProvider] static Promise register(USVString configURL); [RuntimeEnabled=FedCmIdPRegistration, CallWith=ScriptState, ImplementedAs=unregisterIdentityProvider] static Promise unregister(USVString configURL); // Allows an IdP to return a token to the RP from the content area, as opposed to // over HTTP with the id_assertion_endpoint. [CallWith=ScriptState] static Promise resolve(any token, optional IdentityResolveOptions options = {}); };