# Single sign on to organisation

**URL:** <https://community.auth0.com/t/single-sign-on-to-organisation/117290>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [September 27, 2023, 5:04pm UTC](https://community.auth0.com/t/single-sign-on-to-organisation/117290 "2023-09-27T17:04:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kush1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kush1/32/73206_2.png) [@Kush1](https://community.auth0.com/u/Kush1)\
**Post date:** [September 27, 2023, 5:04pm UTC](https://community.auth0.com/t/single-sign-on-to-organisation/117290/1 "2023-09-27T17:04:04Z")

</div>

Hi,

I have an issue with a proof of concept I am looking it.

1. I have two angular applications setup in Auth0,

- for flexibility, both applications are turned on for organisations
- types of user is set to both (direct from database and via organisations membership)

1. Organisation settings are set to ‘enable automatic membership’.
2. The first app is configured as the global login, with the second setup to auto-login (SSO) when the first redirects to it via a button click (using getAccessTokenSilently() call)
3. In Angular config, organization parameter is configured in application two’s auth0 config only.

The issue:  
When a user is in the organisation membership list, after logging into application one, on button click to redirect to application two, silent login works great, and the user it SSO’d into application two.

When a user is not in the organisation membership list, after logging into application one, on click to redirect to application two, silent login (getAccessTokenSilently()) fails stating ‘login required’.

Expected behaviour: The user is added to the organisation membership list on the getAccessTokenSilently() call (enable automatic membership is on).  
The user is silently logged in to application two.

Is there any way this scenario could work (switching organisation, auto adding user to org member list, and silently logging in) ?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 27, 2023, 10:09pm UTC](https://community.auth0.com/t/single-sign-on-to-organisation/117290/3 "2023-09-27T22:09:33Z")

</div>

Hey @Kush1 welcome to the community!

> [@Kush1](#):
>
> The first app is configured as the global login, with the second setup to auto-login (SSO) when the first redirects to it via a button click (using getAccessTokenSilently() call)

Are there more than one organizations involved? Which organization is the user added to when logging into the first app?

---

<div class="post-metadata">

**Author:** ![Kush1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kush1/32/73206_2.png) [@Kush1](https://community.auth0.com/u/Kush1)\
**Post date:** [September 28, 2023, 8:47am UTC](https://community.auth0.com/t/single-sign-on-to-organisation/117290/4 "2023-09-28T08:47:04Z")

</div>

Hi @ty.frith, there potentially could be multiple organisations involved, I’m just testing with one first. The first application doesn’t use an organisation to login so its directly via the connection/database.

Once logged in, via button click, the second application is opened. The organisation at the moment is hard-coded in the auth config on application two which is used for the silent login.

---

<div class="post-metadata">

**Author:** ![Kush1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kush1/32/73206_2.png) [@Kush1](https://community.auth0.com/u/Kush1)\
**Post date:** [September 29, 2023, 8:20am UTC](https://community.auth0.com/t/single-sign-on-to-organisation/117290/6 "2023-09-29T08:20:53Z")

</div>

I’ve figured out a solution for us using custom values being passed in the silent auth request, then adding these to the token in a post login action. Thanks to anyone that had a read and a think 🙂

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 29, 2023, 6:27pm UTC](https://community.auth0.com/t/single-sign-on-to-organisation/117290/7 "2023-09-29T18:27:52Z")

</div>

That’s awesome, thanks for sharing here! 🙂

---

<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:** [October 13, 2023, 6:28pm UTC](https://community.auth0.com/t/single-sign-on-to-organisation/117290/8 "2023-10-13T18:28:17Z")

</div>

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