-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENDOC-578 Update the RBAC tutorial for Entando 7.1 #587
Conversation
|
||
#### Modify Security Checks for Kubernetes | ||
#### Keycloak Client options in an Entando Application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option (capitalized to match style of other headers)
3. Verify that attempting to delete via the UI generates a `403 error` in the browser console and an error in the service logs similar to the following: | ||
1. Restart the microservice. By default, this includes rebuilding any changed source files. | ||
2. Return to the MFE and try deleting one of the Conferences in the list | ||
3. Verify that attempting to delete a conference via the UI generates a `403 error` in the browser console. There should be an error in the service logs similar to the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"conference" is capitalized in the step above, which is contextually similar
|
||
1. In your browser, go to <http://localhost:3000>. This is typically the location of the tableWidget MFE. | ||
2. Access the tableWidget MFE with the default credentials of `username: admin`, `password: admin` | ||
1. In your browser, go to <http://localhost:3000>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove period for consistency
## Notes | ||
### Realm Roles versus Client Authorities | ||
This tutorial utilizes authorities. In Keycloak, authorities are roles mapped to a user for a specific client. It is possible to assign higher-level Realm Roles directly to users, e.g. `ROLE_ADMIN`, but this can result in collisions between applications using the same roles. | ||
### Step 10. Configure the roles in `entando.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer this reference to entando.json
which is not prefaced by "the"; minor but technically correct to not use "the"
To implement Realm-assigned roles, the code above must be modified: | ||
- In the backend, use the annotation `@Secured('ROLE_ADMIN)` or `@PreAuthorize(hasRole('ROLE_ADMIN'))` | ||
- In the frontend, use `keycloak.hasRealmRole` instead of `keycloak.hasResourceRole` | ||
1. Modify the `entando.json` by adding the following line to the `microservices/conference-ms`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "the" :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think it's correct either way, with or without the
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
> Note: Once authenticated, the message "No conferences are available" is generated. If you check your browser | ||
console, you should see a `403 (Forbidden)` error for the request made to `localhost:8080/services/conference/api/conferences`. This is expected because the admin user has not yet been granted the new role. | ||
> Note: Once authenticated, the message "No conferences are available" is generated. If you check your browser console, you should see a `403 (Forbidden)` error for the request made to `localhost:8080/services/conference/api/conferences`. This is expected because the admin user has not yet been granted the new role. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backtick admin in last line
To implement Realm-assigned roles, the code above must be modified: | ||
- In the backend, use the annotation `@Secured('ROLE_ADMIN)` or `@PreAuthorize(hasRole('ROLE_ADMIN'))` | ||
- In the frontend, use `keycloak.hasRealmRole` instead of `keycloak.hasResourceRole` | ||
1. Modify the `entando.json` by adding the following line to the `microservices/conference-ms`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think it's correct either way, with or without the
No description provided.