# Pre-fill / Autofill form fields on login screen

**URL:** <https://forum.keycloak.org/t/pre-fill-autofill-form-fields-on-login-screen/25729>\
**Category:** Miscellanaeous\
**Created:** [April 24, 2024, 12:06pm UTC](https://forum.keycloak.org/t/pre-fill-autofill-form-fields-on-login-screen/25729 "2024-04-24T12:06:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gary](https://forum.keycloak.org/u/gary)\
**Post date:** [April 24, 2024, 12:06pm UTC](https://forum.keycloak.org/t/pre-fill-autofill-form-fields-on-login-screen/25729/1 "2024-04-24T12:06:40Z")

</div>

Hi,  
I want to add some fields which call be pre-filled if some of the keys are coming in the url.  
So can any change can be made of the browser flow i.e. the authentication flow of the user to autofill the username field if coming in the url

[https://keycloak-dev.com/auth/realms/abc/protocol/openid-connect/auth?client\_id=client1&response\_type=code&scope=openid%20email&redirect\_uri=http://localhost:8080&username=gary](https://keycloak-dev.ixor.be/auth/realms/VDL/protocol/openid-connect/registrations?client_id=client1&response_type=code&scope=openid%20email&redirect_uri=http://localhost:8080&username=gary)

Where the username query params could be placed inside the form input fields ?

Or is there another / better way to achieve this ?

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [April 24, 2024, 12:09pm UTC](https://forum.keycloak.org/t/pre-fill-autofill-form-fields-on-login-screen/25729/2 "2024-04-24T12:09:27Z")

</div>

Try `kc_login_hint` instead of `username`.

---

<div class="post-metadata">

**Author:** ![gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gary](https://forum.keycloak.org/u/gary)\
**Post date:** [April 24, 2024, 12:16pm UTC](https://forum.keycloak.org/t/pre-fill-autofill-form-fields-on-login-screen/25729/3 "2024-04-24T12:16:00Z")

</div>

So How will this help me to automatic add the value of the username if it is present in the url of the authentication

And I have tried to add this in the url and it doesn’t auto-fills the username.  
[http://0.0.0.0:8080/realms/workverse/protocol/openid-connect/auth?client\_id=workverse&scope=openid%20profile&redirect\_uri=localhost&response\_type=code&kc\_login\_hint=abc](http://0.0.0.0:8080/realms/workverse/protocol/openid-connect/auth?client_id=workverse&scope=openid%20profile&redirect_uri=localhost&response_type=code&kc_login_hint=abc)

![Screenshot from 2024-04-24 17-45-38](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/4/45e51b71daeb8045b967d18c1d23871701b4d8ec.png)

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [April 24, 2024, 12:30pm UTC](https://forum.keycloak.org/t/pre-fill-autofill-form-fields-on-login-screen/25729/4 "2024-04-24T12:30:13Z")

</div>

I think I mixed it up, should be just `login_hint`, then Keycloak should put the value automatically into the username field.

---

<div class="post-metadata">

**Author:** ![gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gary](https://forum.keycloak.org/u/gary)\
**Post date:** [April 25, 2024, 6:29am UTC](https://forum.keycloak.org/t/pre-fill-autofill-form-fields-on-login-screen/25729/5 "2024-04-25T06:29:15Z")

</div>

Thank you!!! So much.
