Client Autorisierung

Hallo in die Runde! Ich beschäftige mich privat mit Keycloak und bin mir nicht sicher, ob ich etwas falsch verstanden habe. Ich hoffe, ihr könnt mir kurz weiterhelfen. Ich habe einen Client und möchte, dass sich nur Benutzer mit einer bestimmten Rolle daran anmelden dürfen. Wenn ich die Autorisierung im Client konfiguriere, hat das jedoch keine Auswirkung – der Benutzer kann sich trotz „Deny“ Evalution anmelden. Nach stundenlanger Recherche (inklusive KI-Unterstützung) habe ich mehrfach gelesen, dass die Autorisierung nur greift, wenn die Gegenstelle sie auch abfragt. Für meine Lösung muss demnach ein separater Authentication Flow erstellt werden und dann im Client überschrieben werden.

Ist das korrekt?

Ich finde es etwas befremdlich, dass die Autorisierung quasi nur von der Gegenstelle „eingefordert“ werden kann. Wenn die Seite kompromittiert ist, entstehen dadurch für einen Angreifer zusätzliche Möglichkeiten, an Informationen zu gelangen. Vielen Dank schon mal für deine Einschätzung!

Viele Grüße Alex

ChatGPT Translate:

Hello everyone!

I’ve been working with Keycloak privately and I’m not sure if I’ve misunderstood something. I hope you can give me a quick clarification. I have a client and I want only users with a specific role to be able to log in. However, when I configure authorization in the client, it has no effect – the user can still log in despite a “Deny” evaluation.

After hours of research (including AI assistance), I’ve repeatedly read that authorization only takes effect if the relying party actually checks it. For my use case, that would mean I need to create a separate authentication flow and then override it in the client.

Is that correct?

I find it a bit unsettling that authorization can basically only be “enforced” by the relying party. If the application itself is compromised, this seems to open up additional ways for an attacker to gain access to information.

Thanks a lot in advance for your feedback!

Best regards,
Alex

Can no one give me an answer? :frowning:

Yes, It hink you mis-understood a few things.

1.) You always login into a realm on keycloak, not a client. (Otherwise SSo would not work…)

2.) For the authorization flow the client needs to evaluate the permissions on every requests.

( request to client → ask kc if allowed → ….) as the permissions may depend on the requested resources as well. Keycloak is not an authorization gateway.

1 Like