-
Notifications
You must be signed in to change notification settings - Fork 841
[TNZ-27070]: Fix UAA on standard ports #3621
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
Conversation
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.
Pull Request Overview
This PR fixes UAA SAML authentication issues when dealing with standard ports by implementing URL normalization. The fix ensures that URLs with explicitly specified standard ports (80 for HTTP, 443 for HTTPS) are treated as equivalent to their counterparts without explicit port numbers during destination validation.
Key changes:
- Added URL normalization functionality to handle standard port equivalence
- Updated SAML authentication provider to use normalized URLs for destination validation
- Added comprehensive test coverage for the new normalization functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| UaaUrlUtils.java | Added normalizeUrlForPortComparison method to remove standard ports from URLs |
| OpenSaml4AuthenticationProvider.java | Integrated URL normalization into SAML destination validation logic |
| UaaUrlUtilsTest.java | Added comprehensive test suite for the new URL normalization method |
| OpenSaml4AuthenticationProviderUnitTests.java | Added integration tests for SAML authentication with standard port scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server/src/main/java/org/cloudfoundry/identity/uaa/util/UaaUrlUtils.java
Show resolved
Hide resolved
...c/main/java/org/cloudfoundry/identity/uaa/provider/saml/OpenSaml4AuthenticationProvider.java
Show resolved
Hide resolved
strehle
left a comment
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.
beside one remark from sonar
https://sonarcloud.io/summary/new_code?id=cloudfoundry-identity-parent&pullRequest=3621
I dont have further things, so thanks for the PR
server/src/test/java/org/cloudfoundry/identity/uaa/util/UaaUrlUtilsTest.java
Show resolved
Hide resolved
strehle
left a comment
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.
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server/src/main/java/org/cloudfoundry/identity/uaa/util/UaaUrlUtils.java
Show resolved
Hide resolved
fhanik
left a comment
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.
Excellent. Glad we got this back in.
duanemay
left a comment
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.
Awesome!
Fix UAA on standard ports with mismatching Location and Destination