# LOGIN\_ERROR error=user\_not\_found

**URL:** <https://forum.keycloak.org/t/login-error-error-user-not-found/24270>\
**Category:** Getting advice\
**Tags:** authentication\
**Created:** [January 29, 2024, 1:58pm UTC](https://forum.keycloak.org/t/login-error-error-user-not-found/24270 "2024-01-29T13:58:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruth](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ruth](https://forum.keycloak.org/u/ruth)\
**Post date:** [January 29, 2024, 1:58pm UTC](https://forum.keycloak.org/t/login-error-error-user-not-found/24270/1 "2024-01-29T13:58:27Z")

</div>

I have just started to use keycloak, and am doing so via docker on a linux ubuntu system.  
I had started ok, created a new realm and set up a user in the realm, but i could not log in as that user.

`> 2024-01-29 11:24:36,122 WARN [org.keycloak.events] (executor-thread-7) type=LOGIN_ERROR, realmId=d3ff7b76-d072-4519-9a16-0d892435664a, clientId=security-admin-console, userId=null, ipAddress=172.17.0.1, error=user_not_found, auth_method=openid-connect, auth_type=code, redirect_uri=http://localhost:8080/admin/master/console/#/openemr%20dev/users/72906fbd-ede4-4cd7-af8b-9d8e3f0fc8c9/credentials, code_id=afea3bd7-2dce-4edb-81a7-21f67602d6c9, username=ruth`

so when i tried to log in i was just redirected back to the login page. I was trying to solve this and was always able to login as admin, to try things out but…

now the same thing is happening when i try to log in as admin, so i am unable to log in at all to change settings, passwords etc. now, even when i start at admin ([http://localhost:8080/](http://localhost:8080/) ) I get  
2024-01-29 13:31:53,101 WARN [org.keycloak.events] (executor-thread-100) type=LOGIN\_ERROR, realmId=d3ff7b76-d072-4519-9a16-0d892435664a, clientId=security-admin-console, userId=null, ipAddress=172.17.0.1, error=user\_not\_found, auth\_method=openid-connect, auth\_type=code, redirect\_uri=[http://localhost:8080/admin/master/console/](http://localhost:8080/admin/master/console/), code\_id=b2e16bf1-d870-4b0e-a983-7d1a917b3ac0, username=admin

so the main problem seems to be ‘user\_not\_found’ i think.

i would be grateful for any help

---

<div class="post-metadata">

**Author:** ![ruth](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ruth](https://forum.keycloak.org/u/ruth)\
**Post date:** [January 29, 2024, 5:05pm UTC](https://forum.keycloak.org/t/login-error-error-user-not-found/24270/2 "2024-01-29T17:05:38Z")

</div>

reinstalledmy keycloak from scratch to get back my admin log in. but users still can’t log in

---

<div class="post-metadata">

**Author:** ![ThoreKr](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/thorekr/32/7713_2.png) [@ThoreKr](https://forum.keycloak.org/u/ThoreKr)\
**Post date:** [January 29, 2024, 5:14pm UTC](https://forum.keycloak.org/t/login-error-error-user-not-found/24270/3 "2024-01-29T17:14:58Z")

</div>

You said you created a new realm and the user in that realm.

However, the redirect uri is for the master realm

> [@ruth](#):
>
> redirect\_uri=[http://localhost:8080/admin/master/console/](http://localhost:8080/admin/master/console/)

Are you trying to log in in the wrong realm?

Also note that the admin console requires certain client roles to access it. But you should be able to log-in and be greeted with a 403.

---

<div class="post-metadata">

**Author:** ![ruth](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ruth](https://forum.keycloak.org/u/ruth)\
**Post date:** [January 29, 2024, 5:20pm UTC](https://forum.keycloak.org/t/login-error-error-user-not-found/24270/4 "2024-01-29T17:20:35Z")

</div>

thanks thore,

the redirect for the user was to `http://localhost:8080/admin/master/console/#/openemr%20dev/users/72906fbd-ede4-4cd7-af8b-9d8e3f0fc8c9/credentials`

the name of the realm is ‘openemr dev’ - so i think this is a realm specific redirect.

---

<div class="post-metadata">

**Author:** ![ThoreKr](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/thorekr/32/7713_2.png) [@ThoreKr](https://forum.keycloak.org/u/ThoreKr)\
**Post date:** [January 29, 2024, 5:30pm UTC](https://forum.keycloak.org/t/login-error-error-user-not-found/24270/5 "2024-01-29T17:30:20Z")

</div>

No. That’s a login to the master realm to edit something in the other realm. Try [http://localhost:8080/admin/openemr-dev/console/](http://localhost:8080/admin/openemr-dev/console/) or better [http://localhost:8080/realms/openemr-dev/account/](http://localhost:8080/realms/openemr-dev/account/)

---

<div class="post-metadata">

**Author:** ![ruth](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ruth](https://forum.keycloak.org/u/ruth)\
**Post date:** [January 29, 2024, 5:38pm UTC](https://forum.keycloak.org/t/login-error-error-user-not-found/24270/6 "2024-01-29T17:38:20Z")

</div>

> [@ThoreKr](#):
>
> [http://localhost:8080/realms/openemr-dev/account/](http://localhost:8080/realms/openemr-dev/account/)

oh brilliant, thanks, yes that works a treat. I’ve re-read the documentation and realise where i went wrong - didn’t read it carefully enough. thank you very much
