# 401 unauthorized

**URL:** <https://forum.keycloak.org/t/401-unauthorized/24612>\
**Category:** Getting advice\
**Tags:** admin-rest, database, user-federation, ldap, oidc\
**Created:** [February 16, 2024, 4:48pm UTC](https://forum.keycloak.org/t/401-unauthorized/24612 "2024-02-16T16:48:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hug0-stiglitz](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/hug0-stiglitz/32/9790_2.png) [@Hug0-stiglitz](https://forum.keycloak.org/u/Hug0-stiglitz)\
**Post date:** [February 16, 2024, 4:48pm UTC](https://forum.keycloak.org/t/401-unauthorized/24612/1 "2024-02-16T16:48:50Z")

</div>

We have a highly available deployment Keycloak in kubernetes cluster. We have created client with “service accounts roles” and “direct grant acces” which receives infomation users employyeID. After upgrade from 20.01 to 23.06 this process was broken.  
If i do this request curl -X POST -u “TESTCLIENT:XXXXXXXXXXXXXXX” -d “grant\_type=client\_credentials” [https://sso.mydomain.su/realms/myrealm/protocol/openid-connect/token](https://sso.mydomain.su/realms/myrealm/protocol/openid-connect/token)  
and i recived token after this a try to get infornation curl -H “Authorization: Bearer ACCESS\_TOKEN” “[https://sso.mydomain.su/admin/realms/myrealm/users?q=employeeID:1](https://sso.mydomain.su/admin/realms/myrealm/users?q=employeeID:1)” -v  
The request takes a very long time to process and the token expires and i get 401 error unauthorized.  
I have checked requset to database and I see a lot of similar idle transactions without answer. Need help.
