# Can I safely write to \`session.props.auth\` for a custom Perspective login?

**URL:** <https://forum.inductiveautomation.com/t/can-i-safely-write-to-session-props-auth-for-a-custom-perspective-login/107797>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 25, 2025, 7:48pm UTC](https://forum.inductiveautomation.com/t/can-i-safely-write-to-session-props-auth-for-a-custom-perspective-login/107797 "2025-06-25T19:48:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdia](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdia/32/87599_2.png) [@mdia](https://forum.inductiveautomation.com/u/mdia)\
**Post date:** [June 25, 2025, 7:48pm UTC](https://forum.inductiveautomation.com/t/can-i-safely-write-to-session-props-auth-for-a-custom-perspective-login/107797/1 "2025-06-25T19:48:53Z")

</div>

I’m working on a Perspective project where I’d really like the login flow to stay inside my own custom “/login” view instead of launching the built-in IdP page. The idea is:

1. User types username / password on my custom view.
2. I call `system.security.validateUser()` against the default Ignition user source.
3. If the credentials check out, I programmatically set the session’s auth properties so Ignition treats the session as authenticated (roles, security levels, etc.).
4. Navigate to the main app.

The property editor in the Designer shows the little “writable through scripts/bindings” tooltip on `session.props.auth.*`, so in theory I can do something like:

```python
valid = system.security.validateUser(uname, pwd)
if valid:
    # attempt to “log in” manually
    session.props.auth.authenticated = True
    session.props.auth.user = {
        "id": str(system.user.getUser("default", uname).id),
        "userName": uname,
        "firstName": "",
        "lastName": "",
        "email": "",
        "roles": ["Administrator"],
        "timestamp": system.date.now()
    }
    session.props.auth.securityLevels = [
        {"name": "Authenticated", "children": [
            {"name": "Roles", "children": [
                {"name": "Administrator", "children": []}
            ]}
        ]}
    ]
    system.perspective.navigate("/home")
else:
    system.perspective.openPopup("badCreds", "Popups/BadCredentials")

```

Before I lean on this approach I’d like to confirm a few things:

- Does the gateway ever overwrite `session.props.auth` with its own values (heartbeat, security checks, etc.)?
- If I manually populate the auth roles/securityLevels as above, will view security and tag security respect those during the session?
- Has anyone actually shipped a system that does this, and if so have you run into surprises on upgrades?

I know the “official” answer is to use an IdP or redirect to the default login screen, but for branding and UX reasons I’d rather keep everything in a single Perspective view if it’s safe to do so.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [June 25, 2025, 9:47pm UTC](https://forum.inductiveautomation.com/t/can-i-safely-write-to-session-props-auth-for-a-custom-perspective-login/107797/2 "2025-06-25T21:47:30Z")

</div>

> [@mdia](#):
>
> but for branding

Have you looked at the co-branding section of your gateway?

> **[Perspective Co-Branding | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/perspective-co-branding)**
>
> Perspective Co-Branding is a Gateway setting that allows users to customize the look of their Perspective Sessions with logos, pictures, and colors. Various aspects of Perspective can be customized, such as the login screen, the desktop icon, and...

---

<div class="post-metadata">

**Author:** ![mdia](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdia/32/87599_2.png) [@mdia](https://forum.inductiveautomation.com/u/mdia)\
**Post date:** [June 25, 2025, 10:01pm UTC](https://forum.inductiveautomation.com/t/can-i-safely-write-to-session-props-auth-for-a-custom-perspective-login/107797/3 "2025-06-25T22:01:11Z")

</div>

Unfortunately that won't work. Planning to use a combination of different color schemes, logos, etc. on the same gateway.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 25, 2025, 10:25pm UTC](https://forum.inductiveautomation.com/t/can-i-safely-write-to-session-props-auth-for-a-custom-perspective-login/107797/4 "2025-06-25T22:25:44Z")

</div>

You cannot roll your own security like this, it just won't work. You cannot simply write to those session props and magically login. If you could, Ignition would be shred to pieces in any security challenge
