Skip to content
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

Standardize the examples #980

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

survivant
Copy link

I updated the sample to have the same structure. It's easier to compare between them.

@survivant
Copy link
Author

@sberyozkin here the new PR for the development branch. CC @gsmet

@@ -32,6 +32,10 @@
</dependencyManagement>

<dependencies>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@survivant Why is this module added here ? There is a dedicated keycloak-authorization-quickstart

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sberyozkin maybe it's not necessary. I though it was used by KeycloakTestClient. So the sample : security-keycloak-authorization-quickstart need that module to check in Keycloak if a URL is authorized for the user logged.

and the sample : security-openid-connect-quickstart will received a token with the roles in it and use that to validate if the user is authorized with the annotation @RolesAllowed so the dependency to keycloak autorisation is not needed ?

did I understand correctly the difference between the two samples ?

RestAssured.given().auth().oauth2(getAccessToken("admin"))
.when().get("/api/admin")
.when().get("/api/users/me")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@survivant Hmm but this drops a check that alice (who only has a user role) can not access admin-level resources

RestAssured.given().auth().oauth2(getAccessToken("alice"))
.when().get("/api/users/me")
.when().get("/api/admin")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly for admin

@survivant
Copy link
Author

@sberyozkin the goal was to get the samples : security-openid-connect-quickstart and security-keycloak-authorization-quickstart almost similar except one use the token and the other roles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants