la-wu commented on issue #13861:
URL: https://github.com/apache/cloudstack/issues/13861#issuecomment-7163787811
just a short hint for all users that might be affected by this issue.
As a workaround we limited the cloudstack client in keycloak to just the
users that are created in cloudstack.
Below are the steps we did in keycloak:
- Go to the desired client → roles → create role (give a proper name like
cloudstack-access)
- Go to users → for each cloudstack user → Role mapping → Assign role →
client role → select the newly created role (e.g. cloudstack-access)
- Create an authentication flow that checks the role assignment. If the user
is not part of the role keycloak will block access and never forward a token to
cloudstack. To do so:
1. Under Authentication → Flows, open the copy browser-cloudstack.
2. On the forms sub-flow (menu on the right, plus icon), choose Add
sub-flow. Name it e.g. Deny without cloudstack role. Set the requirement of
the new sub-flow to Conditional. and move it under the forms sub-flow.
3. In this sub-flow, choose Add condition and add Condition - User Role.
Set its requirement to Required.
4. Open the condition's configuration via the gear icon:
- Alias: anything, e.g. has-role.
- User role: select the role you created at the beginning (e.g.
cloudstack-access).
- Negate output: enable it.
5. In the same sub-flow, choose Add execution and add Deny access. Set its
requirement to Required.
6. Via the gear icon of Deny access, set an Alias and optionally an Error
message. If the field is left empty, the default message access-denied is shown.
- Bind the flow to the client: Clients → <your cloudstack client> Advanced →
Authentication flow overrides → Browser Flow (at the end) → select the newly
created flow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]