LOGIN_ERROR error=user_not_found

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/ ) 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/, 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

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

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

However, the redirect uri is for the master realm

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.

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.

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

1 Like

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