Skip to content

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Dec 13, 2025

Summary

  • Replace dynamic IPv6/localhost detection with configurable base URL properties for OIDC and SAML authenticators
  • Add oic.base.url property for OpenIdConnectAuthenticator
  • Add saml.sp.base.url property for SamlAuthenticator
  • Default to http://localhost:8080 for backward compatibility
  • Add comprehensive Javadoc documentation for SAML configuration

Test plan

  • Unit tests updated for new configuration approach
  • Verify OIDC SSO works with default localhost URL
  • Verify OIDC SSO works with custom base URL
  • Verify SAML SSO works with default localhost URL
  • Verify SAML SSO works with custom base URL

🤖 Generated with Claude Code

Replace dynamic IPv6/localhost detection with configurable base URL properties
for OIDC and SAML authenticators:

- Add oic.base.url property for OpenIdConnectAuthenticator
- Add saml.sp.base.url property for SamlAuthenticator
- Default to http://localhost:8080 for compatibility
- Add comprehensive Javadoc for SAML configuration
- Update tests for new configuration approach

This simplifies SSO setup by allowing explicit base URL configuration
instead of relying on network address detection.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@marevol marevol self-assigned this Dec 13, 2025
@marevol marevol requested a review from Copilot December 13, 2025 06:44
@marevol marevol added this to the 15.4.0 milestone Dec 13, 2025
Copy link
Contributor

Copilot AI left a 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 replaces dynamic IPv6/localhost detection with configurable base URL properties for SSO authenticators to improve deployment flexibility and configuration clarity.

Key Changes:

  • Introduced saml.sp.base.url and oic.base.url configuration properties with http://localhost:8080 as the default fallback
  • Removed dependency on IpAddressUtil and dynamic IP resolution in favor of explicit configuration
  • Added comprehensive Javadoc documentation for SAML configuration including setup examples for popular IdPs

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/main/java/org/codelibs/fess/sso/saml/SamlAuthenticator.java Replaced dynamic URL building with configurable base URL property saml.sp.base.url and added extensive Javadoc documentation
src/main/java/org/codelibs/fess/sso/oic/OpenIdConnectAuthenticator.java Replaced dynamic URL building with configurable base URL property oic.base.url
src/test/java/org/codelibs/fess/sso/saml/SamlAuthenticatorTest.java Updated tests to verify new configuration-based URL building with comprehensive edge case coverage
src/test/java/org/codelibs/fess/sso/oic/OpenIdConnectAuthenticatorTest.java Updated tests to verify new configuration-based URL building with comprehensive edge case coverage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +181 to +182
DynamicProperties systemProperties = ComponentUtil.getSystemProperties();
systemProperties.remove("saml.sp.base.url");
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

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

The property removal at the start of the test assumes a clean state, but if a previous test failed without cleanup, this property might still be set. Consider adding a @before method or test fixture to ensure consistent test isolation by clearing this property before each test runs.

Copilot uses AI. Check for mistakes.
Comment on lines +157 to +158
DynamicProperties systemProperties = ComponentUtil.getSystemProperties();
systemProperties.remove("oic.base.url");
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

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

The property removal at the start of the test assumes a clean state, but if a previous test failed without cleanup, this property might still be set. Consider adding a @before method or test fixture to ensure consistent test isolation by clearing this property before each test runs.

Copilot uses AI. Check for mistakes.
@marevol marevol merged commit ecdbfa5 into master Dec 14, 2025
1 check passed
@marevol marevol deleted the feature/sso-configurable-base-url branch December 25, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants