# Returning auth extra information on launch

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-auth-extra-information-on-launch%2F53114%3E%5C
**Category:** 🔒 Gradio\
**Created:** [September 1, 2023, 10:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-auth-extra-information-on-launch%2F53114 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fzhcr)%5C
**Post date:** [September 1, 2023, 10:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-auth-extra-information-on-launch%2F53114%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLexius)%5C
**Post date:** [November 15, 2023, 2:50pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-auth-extra-information-on-launch%2F53114%2F2 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpanigrah)%5C
**Post date:** [November 15, 2023, 3:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-auth-extra-information-on-launch%2F53114%2F3 "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.
