# Restricting access for users to clients

**URL:** https://forum.keycloak.org/t/restricting-access-for-users-to-clients/5655
**Category:** Getting advice
**Tags:** authentication, client-configuration
**Created:** [October 29, 2020, 9:15am UTC](https://forum.keycloak.org/t/restricting-access-for-users-to-clients/5655 "2020-10-29T09:15:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![waltertamboer](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/waltertamboer/32/1587_2.png) [@waltertamboer](https://forum.keycloak.org/u/waltertamboer)
#### Post date: [October 29, 2020, 9:15am UTC](https://forum.keycloak.org/t/restricting-access-for-users-to-clients/5655/1 "2020-10-29T09:15:14Z")

</div>

Hi,

I have a Single Page Application (SPA). For this application I created a public client so that we can manage authentication for users. We have multiple customers and each customer has its own client id. Now I want to prevent users from logging in to certain client. This doesn’t seem possible straight out of the box in Keycloak.

I found a solution by creating an authentication script ([https://stackoverflow.com/questions/54305880/how-can-i-restrict-client-access-to-only-one-group-of-users-in-keycloak/57271777#57271777](https://stackoverflow.com/questions/54305880/how-can-i-restrict-client-access-to-only-one-group-of-users-in-keycloak/57271777#57271777)), just wanted to run this by the community to make sure this is the correct approach.

Thank you!
