files/en-us/web/api/identitycredentialrequestoptions/index.md
{{APIRef("FedCM API")}}{{SecureContext_Header}}{{SeeCompatTable}}
The IdentityCredentialRequestOptions dictionary represents the object passed to {{domxref("CredentialsContainer.get()")}} as the value of the identity option.
When an identity option is provided in a get() call made on a {{glossary("Relying party", "relying party")}} (RP) website, the user is offered a list of {{glossary("identity provider", "federated identity providers")}} (IdPs) as sign-in options. Once the user signs in successfully using one of these options, the promise returned by the get() call returns an {{domxref("IdentityCredential")}} object.
context {{optional_inline}}
: A string specifying the context in which the user is authenticating with FedCM. The browser uses this value to vary the text in its FedCM UI to better suit the context. Possible values are:
"continue"
: Suitable for situations where the user is choosing an identity to continue to the next page in the flow, which requires a sign-in. Browsers will provide a text string similar to:
Continue to <page-origin> with <IdP>
"signin"
: Suitable for general situations where the user is signing in with an IdP account they've already used on this origin. Browsers will provide a text string similar to:
Sign in to <page-origin> with <IdP>
"signup"
: An option for situations where the user is signing in to the origin with a new IdP account they've not used here before. Browsers will provide a text string similar to:
Sign up to <page-origin> with <IdP>
"use"
: Suitable for situations where a different action, such as validating a payment, is being performed. Browsers will provide a text string similar to:
Use <page-origin> with <IdP>
The default value is "signin".
mode {{optional_inline}}
: A string specifying the UI mode to use for the sign-in flow. Possible values are:
active
mode is set to active, providers can only have a length of 1, otherwise the get() promise will reject.passive
See Active versus passive mode for more details of the difference between the two modes.
providers
configURL
clientId
domainHint {{optional_inline}}
domain_hints array. If "any" is specified, the RP will show any account that is associated with at least one domain hint.fields {{optional_inline}}
"name", "email", or "profile-picture-url".loginHint {{optional_inline}}
loginHint property can be taken from the user's previous sign-in, and is matched against the login_hints values provided by the IdP in the array of user information returned from the IdP's accounts list endpoint.nonce {{optional_inline}}
: A random string that can be included to ensure the response is issued specifically for this request and prevent {{glossary("replay attack", "replay attacks")}}.
[!NOTE] This property has been removed from the specification, because not all the protocols that use the FedCM API require a nonce. If the RP does need to include a nonce, it should be provided in the
paramsproperty.
params {{optional_inline}}
{{Specifications}}
{{Compat}}