Team 10 ase 39 disable csrf#13
Merged
davidclarafigueiredo merged 14 commits intomainfrom Sep 24, 2025
Merged
Conversation
we just copy-pasted the code from the tutorial and hope that it works
…et roles, need to add jwt mapping to model
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements JWT-based OAuth2 authentication with Keycloak integration and disables CSRF protection. The changes introduce a complete security configuration that replaces cookie-based authentication with token-based authentication.
- Adds OAuth2 resource server configuration with JWT support
- Implements role-based authorization using Keycloak realm roles
- Creates security configuration that disables CSRF for API endpoints
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/application.yaml | Adds OAuth2 JWT configuration and server port |
| src/main/java/com/ase/userservice/security/SecurityConfig.java | Implements security filter chain with CSRF disabled and JWT authentication |
| src/main/java/com/ase/userservice/security/JwtAuthConverter.java | Converts JWT claims to Spring Security authorities |
| src/main/java/com/ase/userservice/controllers/DemoController.java | Adds demo endpoint for testing role-based access |
| pom.xml | Adds Spring Security and OAuth2 resource server dependencies |
| Dockerfile | Creates containerized deployment configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/main/java/com/ase/userservice/security/JwtAuthConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/ase/userservice/security/SecurityConfig.java
Dismissed
Show dismissed
Hide dismissed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
LucaSchmitz2003
approved these changes
Sep 24, 2025
davidclarafigueiredo
pushed a commit
that referenced
this pull request
Oct 17, 2025
* pls fix * pls fix * pls fix? * pls fix? * remove accident changes * pls fix? * only deploy on main * please let this work 🙏 * revert changes * fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
disabled csrf since we dont use cookie auth and it only makes trouble