# What we can do with Cross App SSO

**URL:** <https://community.auth0.com/t/what-we-can-do-with-cross-app-sso/147371>\
**Category:** Get Help\
**Tags:** application, sso\
**Created:** [September 17, 2024, 9:24am UTC](https://community.auth0.com/t/what-we-can-do-with-cross-app-sso/147371 "2024-09-17T09:24:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![t.fukao](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/t.fukao/32/61052_2.png) [@t.fukao](https://community.auth0.com/u/t.fukao)\
**Post date:** [September 17, 2024, 9:24am UTC](https://community.auth0.com/t/what-we-can-do-with-cross-app-sso/147371/1 "2024-09-17T09:24:35Z")

</div>

I’d like to get a clear understanding of how Cross App SSO can be used.

I have two applications.  
They must be separated completely, meaning that they cannot share the same top-level domain.  
The Database can be shared.

e.g,  
App1 : [https://app1.com](https://app1.com)  
App2 : [https://app2.com](https://app2.com)

①Assume the user had App1 and App2 open simultaneously in one browser.  
②Next, the user clicks the login button in App1 and authenticates with App1 via Universal Login.  
③In that state, if the user refreshes the page of App2, the user automatically logged into App2.

The above scenario is the use case I have envisaged.  
Is it possible with Auth0?

Through trial and error, I’ve found that the following behavior seems achievable.  
①② same as described above.  
③The user clicks the login button in App2, then the user can logged into App2 **without** Universal Login.

Is this the limit of what we can achieve with Auth0?

---

<div class="post-metadata">

**Author:** ![t.fukao](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/t.fukao/32/61052_2.png) [@t.fukao](https://community.auth0.com/u/t.fukao)\
**Post date:** [September 19, 2024, 1:58am UTC](https://community.auth0.com/t/what-we-can-do-with-cross-app-sso/147371/2 "2024-09-19T01:58:48Z")

</div>

I’ve found the solution.  
When accessing a page with Root Guard without authentication, the user will be redirected to the Universal Login screen.

So I made a global middleware like this.

```bash
import { useAuth0, authGuard } from "@auth0/auth0-vue";
import type { RouteLocationNormalized } from "vue-router";

export default async function (to: RouteLocationNormalized) {
  const auth0 = useAuth0();
  const { isAuthenticated, isLoading } = auth0;

  // watch the loading flag
  Object.defineProperty(isLoading, "_value", {
    set: async (): Promise<void | boolean> => {
      if (isAuthenticated.value) {
        // get JWT token here
      } else {
        if (to.path !== "/login") {
          return await authGuard(to);
        }
      }
    },
  });
}

```

I’m using Nuxt3 and Vue SDK.  
Since the official Nuxt SDK is not available, I’m not sure if this is the correct approach.

Is there a better way?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 2, 2025, 6:55pm UTC](https://community.auth0.com/t/what-we-can-do-with-cross-app-sso/147371/3 "2025-04-02T18:55:35Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
