navigator.login is a read-only Navigator property that returns a NavigatorLogin object (MDN). A federated identity provider (IdP) uses it to tell the browser whether any users are signed into the IdP — part of the Login Status API for FedCM.
Read the notes below before you rely on this property. Prefer feature detection when support is limited.
Syntax
Use navigator.login. Start with this line.
JavaScript
navigator.login
Call
What it does
navigator.login
Primary signature.
Built into the browser. Read navigator.login on Navigator — no import required.
Library declarations
JavaScript
navigator.login
Parameters
Parameter
Description
setStatus(status)
Required. Report IdP login state to the browser
"logged-in" / "logged-out"
Required. Only allowed status strings
Return Value
Return Value
Description
*
Promise<undefined>
JavaScript Examples
Example 1 — Feature Detection
Check whether navigator.login is exposed before calling setStatus.
JavaScript
const supported = Boolean(navigator.login);
console.log(
supported ? "Login Status API available" : "Login Status API missing"
);
Login Status API available
(or "Login Status API missing" in unsupported browsers)
How It Works
Read the property. Unsupported browsers leave it undefined.
Coerce to Boolean. A clear yes/no for branching.
Skip when missing. IdP sites can still run without FedCM status.
Still check HTTPS. Presence alone is not enough on insecure pages.
Example 2 — Secure Context Check
Confirm HTTPS / localhost together with navigator.login.
JavaScript
const lines = [
"secure: " + window.isSecureContext,
"login: " + Boolean(navigator.login)
];
if (!window.isSecureContext) {
lines.push("Serve over HTTPS to use navigator.login");
} else if (!navigator.login) {
lines.push("Secure, but Login Status API not exposed");
} else {
lines.push("Ready to call setStatus");
}
console.log(lines.join("\n"));
Detect method + property. Double-check setStatus is a function.
Try / catch. Convert thrown errors into a plain result object.
Return structured status. Easy to log or show in IdP UI.
Reuse for both statuses. Pass "logged-in" or "logged-out".
Compatibility
Browser Support
navigator.login is part of the Login Status API for FedCM. Support is limited — feature-detect and require a secure context.
✓ Limited availability · Secure context
Navigator.login
Available in supporting Chromium-based browsers on HTTPS. Often missing in Safari. Always detect before calling setStatus.
55%Modern browser support
Google ChromeLogin Status · secure context
Limited
Microsoft EdgeFollow Chromium FedCM / Login Status
Limited
OperaFollow Chromium when exposed
Limited
Mozilla FirefoxCheck current FedCM / Login Status support
Limited
Apple SafariOften unavailable
Unavailable
Internet ExplorerNo Login Status / navigator.login
Unavailable
navigator.loginLimited
Bottom line: Treat Login Status as progressive enhancement for IdP sites. Soft-fail when the API is missing so sign-in and sign-out still work.
Frequently Asked Questions
A read-only NavigatorLogin object so a federated identity provider (IdP) can tell the browser whether any users are logged into the IdP (Login Status API / FedCM).
MDN does not mark it Deprecated, Experimental, or Non-standard. Support is still limited (often missing in Safari). Always feature-detect and require a secure context.
The IdP site — after a user signs in or out on the IdP’s own origin. Relying parties (websites that use “Sign in with …”) do not use this to log users into their own app.
"logged-in" means at least one user account is signed in at the IdP. "logged-out" means all IdP accounts are signed out.
So the browser can skip useless account requests when nobody is logged into the IdP, and to help mitigate timing attacks related to federated sign-in.
Yes. It is available only in secure contexts (HTTPS or localhost). setStatus also requires same-origin framing rules when used inside iframes.