# Returning auth extra information on launch

**URL:** <https://discuss.huggingface.co/t/returning-auth-extra-information-on-launch/53114>\
**Category:** 🔒 Gradio\
**Created:** [September 1, 2023, 10:49am UTC](https://discuss.huggingface.co/t/returning-auth-extra-information-on-launch/53114 "2023-09-01T10:49:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhcr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/zhcr/32/2397_2.png) [@zhcr](https://discuss.huggingface.co/u/zhcr)\
**Post date:** [September 1, 2023, 10:49am UTC](https://discuss.huggingface.co/t/returning-auth-extra-information-on-launch/53114/1 "2023-09-01T10:49:45Z")

</div>

I have integrated a small demo with some login API but I want to store in the session state the username entered in that login.

Is there a way to access it?

```auto
def keycloak_auth(username, password):
    keycloak_openid = KeycloakOpenID(
        server_url="", client_id="", realm_name=""
    )
    # Get Token
    token = keycloak_openid.token(username, password)
    gr.Text(value=username, label="username")

    return token

demo.launch(auth=keycloak_auth, auth_message="Enter your credentials", enable_queue=True)

```

---

<div class="post-metadata">

**Author:** ![Lexius](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lexius](https://discuss.huggingface.co/u/Lexius)\
**Post date:** [November 15, 2023, 2:50pm UTC](https://discuss.huggingface.co/t/returning-auth-extra-information-on-launch/53114/2 "2023-11-15T14:50:14Z")

</div>

I have the exact same need…

---

<div class="post-metadata">

**Author:** ![panigrah](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@panigrah](https://discuss.huggingface.co/u/panigrah)\
**Post date:** [November 15, 2023, 3:14pm UTC](https://discuss.huggingface.co/t/returning-auth-extra-information-on-launch/53114/3 "2023-11-15T15:14:44Z")

</div>

Look at `gr.State()` and [Interface State](https://www.gradio.app/guides/interface-state). This lets you store a state across pages per user.
