# Custom Universal Login, multiple Connections, and security

**URL:** <https://community.auth0.com/t/custom-universal-login-multiple-connections-and-security/61134>\
**Category:** Get Help\
**Tags:** login, connections, universal-login\
**Created:** [April 15, 2021, 8:58am UTC](https://community.auth0.com/t/custom-universal-login-multiple-connections-and-security/61134 "2021-04-15T08:58:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![n.curin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/n.curin/32/27468_2.png) [@n.curin](https://community.auth0.com/u/n.curin)\
**Post date:** [April 15, 2021, 8:58am UTC](https://community.auth0.com/t/custom-universal-login-multiple-connections-and-security/61134/1 "2021-04-15T08:58:29Z")

</div>

Hi,

Cutting to the point, what we currently have : 3 different Connections (Development, Staging, and a “demo” environment to show the app to prospects), 3 corresponding Applications, one Login page using React / Authorize call.

We need to implement a customized Universal Login, and did so, using the “Custom Login Form” template. It does work, and looks like we want it to. However, our problem on this is that the parameter “connection” in the authorize call isn’t being transferred to the Universal Login ; the `config.connection` variable isn’t populated, which means we had to make some dictionary on the login page to choose which database to connect to (the user shouldn’t have the choice). For example :

```
const ENV_DICT = {
      STAGING: {
          TITLE: 'Title 1',
          DB: 'Staging_DB',
      },
      DEMO: {
          TITLE: 'Title 2',
          DB: 'Demo_DB',
      },
      DEFAULT: {
          DB: 'Development_DB',
      },
};

```

And then, later on, using the correct databaseConnection in `webAuth.login` call :

```
webAuth.login({
     realm: databaseConnection,
     //username/password...

```

What we’re wondering is : is showing the connection name actually secure? Is there another way to do this “branching” without using a dummy dictionary?

Thanks!  
Nathanael

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 15, 2021, 12:09pm UTC](https://community.auth0.com/t/custom-universal-login-multiple-connections-and-security/61134/3 "2021-04-15T12:09:17Z")

</div>

Hi @n.curin,

Welcome to the Community!

The `config.connection` variable is passed to the Universal Login when the `/authorize` endpoint is called. You can send it from the React code when you call `loginWithRedirect`:

```auto
loginWithRedirect({connection: 'Your-Connection-Name'})

```

As far as showing the connection name in the Universal Login code, I don’t believe there is a risk there.

---

<div class="post-metadata">

**Author:** ![n.curin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/n.curin/32/27468_2.png) [@n.curin](https://community.auth0.com/u/n.curin)\
**Post date:** [April 16, 2021, 12:11pm UTC](https://community.auth0.com/t/custom-universal-login-multiple-connections-and-security/61134/4 "2021-04-16T12:11:51Z")

</div>

Hi,

Thank you for the quick response 🙂 ! It was just a detail then, it seems to be working fine now.

---

<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:** [May 1, 2021, 12:12pm UTC](https://community.auth0.com/t/custom-universal-login-multiple-connections-and-security/61134/5 "2021-05-01T12:12:33Z")

</div>

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