# Direct login to Keycloak as admin / normal user

**URL:** <https://forum.keycloak.org/t/direct-login-to-keycloak-as-admin-normal-user/21904>\
**Category:** Configuring the server\
**Created:** [May 4, 2023, 1:23pm UTC](https://forum.keycloak.org/t/direct-login-to-keycloak-as-admin-normal-user/21904 "2023-05-04T13:23:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniellienert](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/daniellienert/32/8472_2.png) [@daniellienert](https://forum.keycloak.org/u/daniellienert)\
**Post date:** [May 4, 2023, 1:23pm UTC](https://forum.keycloak.org/t/direct-login-to-keycloak-as-admin-normal-user/21904/1 "2023-05-04T13:23:05Z")

</div>

Hello,

on our Keycloak instance, we have users with role admin as well as “normal” users not allowed to access the realm configuration dialogs.

If a user without an admin role logs in directly, the admin UI with status 403 is shown.  
Is there a way, to send these users directly to the account management for managing their own account instead to admin ui?

Currently we solved this task by adjusting the UI and redirecting the user in case of an error, but I hope there is a cleaner way to go.

Thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![weltonrodrigo](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/weltonrodrigo/32/3104_2.png) [@weltonrodrigo](https://forum.keycloak.org/u/weltonrodrigo)\
**Post date:** [May 4, 2023, 3:13pm UTC](https://forum.keycloak.org/t/direct-login-to-keycloak-as-admin-normal-user/21904/2 "2023-05-04T15:13:36Z")

</div>

The admin UI is actually just an application that itself uses keycloak to login. The account management is another app.

Also, you have a special realm, called master, whose admin console can see the other realms beyond itself.

But you also have the `https://myserver.org/admin/<realmname>/console` which is the admin console for _only_ the `realmname` realm.

Unfortunately, there is not way to automaticallly redirect users from the admin (master or not) console to the account management app.

What you can do is to give users only the account management url which is `https://myserver.org/realms/<realmname>/account/` and only give the console url to admin users.

You can also create a intermediate page somewhere (in your app, maybe?) with a link to both the admin console and the account console and let users choose there.

---

<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:** [May 6, 2023, 8:19am UTC](https://forum.keycloak.org/t/direct-login-to-keycloak-as-admin-normal-user/21904/3 "2023-05-06T08:19:06Z")

</div>

OIDC is all about “client-initiated _something_”.  
You don’t have anything like a “direct login”, that’s only possible with SAML, as SAML also supports a IdP-initiated authentication.

In OIDC you always start the authentication at a client (application), which then redirects to the IdP login process. After successful authentication, the user will be redirected back to the client and it’s in the responsibility of the client to decide what to do in which way.

The admin-ui is one client, the account-console is another client. If the clients don’t have anything implemented that would work as an automatic redirect to another client, your requirement won’t work.

---

<div class="post-metadata">

**Author:** ![daniellienert](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/daniellienert/32/8472_2.png) [@daniellienert](https://forum.keycloak.org/u/daniellienert)\
**Post date:** [May 8, 2023, 10:55am UTC](https://forum.keycloak.org/t/direct-login-to-keycloak-as-admin-normal-user/21904/4 "2023-05-08T10:55:12Z")

</div>

Hey guys,

thank you very much for your answers and the clarification!  
With this food for thought, we are sure to find a workable solution.

Best regards  
Daniel
