# Daml-ui-template - Login with users

**URL:** <https://forum.canton.network/t/daml-ui-template-login-with-users/4594>\
**Category:** App Development\
**Created:** [May 23, 2022, 11:11am UTC](https://forum.canton.network/t/daml-ui-template-login-with-users/4594 "2022-05-23T11:11:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashok\_Raj](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ashok_raj/32/4005_2.png) [@Ashok\_Raj](https://forum.canton.network/u/Ashok_Raj)\
**Post date:** [May 23, 2022, 11:11am UTC](https://forum.canton.network/t/daml-ui-template-login-with-users/4594/1 "2022-05-23T11:11:53Z")

</div>

With daml 2.0, the partys are named as party:hashkey, as a result, when i have to log in to the daml ui template, i have to copy the complete party id from a contract in navigator. I would like to log in using the username alice instead of alice:21312312…c123. So what is the best way to do this?

---

<div class="post-metadata">

**Author:** ![georg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/georg/32/368_2.png) [@georg](https://forum.canton.network/u/georg)\
**Post date:** [May 23, 2022, 3:35pm UTC](https://forum.canton.network/t/daml-ui-template-login-with-users/4594/2 "2022-05-23T15:35:07Z")

</div>

We haven’t gotten around to updating `daml-ui-template` to make use of the user concept in 2.0 yet. What has worked for me in a different codebase is the following:

- Change the startup script (that allocates parties) to return `Script [(Text, Party)]`
- Return the list of tuples (partyName, party) from that script
- Add `script-options` to your daml.yaml file to output the returned data into a JSON file:

```haskell
script-options:
  - --output-file=ui/src/parties.json

```

- Import the JSON file in your UI code like this:

```haskell
import partyList from "./parties.json";

```

- The `partyList` object is now the list of (partyName, party) tuples. A tuple is access via `_1` and `_2` fields
- From here you can hook that information into your login flow such that you can login with party names instead of parties

The above is not something suitable for production, where I’d definitely suggest to make use of the user feature in 2.0, but it’s good enough for a demo codebase.

I’d also suggest to have a look at how our “getting started” example (`create-daml-app`) does it.
