<div dir="ltr">Hi everyone,<div><br></div><div>We discovered Keycloak very recently (pretty impressive tool by the way, congrats to the maintainers!), and we&#39;ve been trying to configure a very simple authorization at the Keycloak level without success.</div><div><br></div><div>Let me try to sum up what we are trying to achieve in our web-application.</div><div><br></div><div>For a Keycloak Client, we would like to only allow the users with a particular Role to be able to login.</div><div><br></div><div>We thought that to achieve this, we needed to do this:</div><div>- Authorization enabled on the client</div><div>- Create a new Role-Based policy ton a particular role</div><div>- Create a Resource Permission to use the previously created Policy </div><div>- Use this Resource Permission in the Default Resource of the Client</div><div><br></div><div>We use openid-connect, and more specifically Google as the identity provider.</div><div><br></div><div>By doing this, we thought that users without the role, trying to connect to our application through Keycloak, would be redirected to our application with an error of authentication, something like this in the redirection:</div><div><br></div><div>/login/oauthVerify?client_name=OidcClient&amp;error=unauthorized&amp;error_description=You%20are%20not%20allowed%20to%20access%20this%20application.&amp;state=CrsA9f9bEzLWyjQfT5PN43MPxl_PfMgvXZDQrEzCHi8<br></div><div><br></div><div>Instead, it&#39;s like Keycloak does not check the Authorization configuration, it redirects to our webapp with a proper authorization code. Then the application is able to fetch the JWT successfully form the Keycloak token endpoint.</div><div><br></div><div>Did we miss something? Are we trying to solve our issue in the wrong way ?</div><div><br></div><div>Thank you all for your help,</div></div>