> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cross-Origin Authentication

> An explanation of cross-origin authentication in Auth0 and its compatibility with browsers

Auth0 uses the cross-origin authentication flow when an embedded login form (the Lock widget or a custom login form) collects credentials in your application and submits them to an Auth0 domain. On Auth0, this flow has built-in protections, including third-party cookies for browser-side checks, for better authentication security across origins.

Using third-party cookies allows Lock and Auth0's backend to perform the necessary checks to prevent phishing and other cross-origin attacks when creating a single sign-on (Single Sign-On (SSO): Service that, after a user logs into one applicaton, automatically logs that user in to other applications.) (SSO) experience with the Lock widget or a custom login form. It also produces a secure login experience even if SSO is not a goal.

Cross-origin authentication applies only when authenticating against a directory using a username and password from a web application, and it can be enabled alongside [Universal Login](/docs/docs/authenticate/login/auth0-universal-login) in the same app. For example, your application can use Universal Login for primary sign-in and rely on cross-origin authentication only for an embedded re-authentication or step-up flow. Social IdPs (Identity Provider (IdP): Service that stores and manages digital identities.) and enterprise federation use a different mechanism, redirecting via standard protocols like OpenID (OpenID: Open standard for authentication that allows applications to verify users' identities without collecting and storing login information.) Connect and SAML (OpenID: Open standard for authentication that allows applications to verify users' identities without collecting and storing login information.). Native applications using embedded login use the standard OAuth 2.0 (Token Endpoint: Endpoint on the Authorization Server that is used to programmatically request tokens.) Token endpoint (OAuth 2.0: Authorization framework that defines authorization protocols and workflows.) directly and do not need cross-origin authentication.

## Browser considerations

Modern browsers (including Firefox, Safari with ITP, and Chromium-based browsers) restrict or block third-party cookies by default for privacy reasons. Web applications relying on third-party cookies for cross-origin authentication may fail in those browsers.

To make embedded login work reliably across browsers for production embedded web applications, use the same top-level domain for your application and Auth0 tenant. For example, host your app at `https://example.com` and your Auth0 custom domain at `https://login.example.com`.

With this configuration, the cookies are no longer third party and browsers do not block them. As a security best practice, we recommend using a [custom domain](/docs/docs/customize/custom-domains) or multiple custom domains with the same top-level domain.

For testing or in controlled environments with clear browser coverage requirements, you can create and link a cross-origin verification page that allows cross-origin authentication to work in those specific browsers when third-party cookies are still permitted.

## Learn more

* [Configure Cross-Origin Resource Sharing](/docs/docs/get-started/applications/set-up-cors)
* [Hosted Login vs. Embedded Login](/docs/docs/authenticate/login/universal-vs-embedded-login)
* [Auth0 Universal Login](/docs/docs/authenticate/login/auth0-universal-login)
