Skip to content

Release #138

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

Merged
merged 10 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ body:
validations:
required: true

- type: textarea
id: description
attributes:
label: Description of the problem
description: |
Describe as exactly as possible what is not working.
validations:
required: true

- type: textarea
id: steps-to-reproduce
attributes:
Expand All @@ -47,20 +56,6 @@ body:
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: |
Tell us what you expect to happen.
- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: |
Tell us what happens with the steps given above.
- type: textarea
id: additional-information
attributes:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.1.0
* Updated to Spring Security 6.5+ / Spring Boot 3.5+
* [``Extendable``] Backported some minor upstream changes

# 2.0.1
* Migrated deployment to _Sonatype Maven Central Portal_ [#155](https://github.com/xdev-software/standard-maven-template/issues/155)
* Updated dependencies
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.xdev</groupId>
<artifactId>spring-security-advanced-authentication-ui-root</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.23.1</version>
<version>10.24.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down
6 changes: 3 additions & 3 deletions spring-security-advanced-authentication-ui-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>software.xdev</groupId>
<artifactId>spring-security-advanced-authentication-ui-root</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
</parent>

<artifactId>spring-security-advanced-authentication-ui-demo</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand All @@ -28,7 +28,7 @@

<mainClass>software.xdev.Application</mainClass>

<org.springframework.boot.version>3.4.5</org.springframework.boot.version>
<org.springframework.boot.version>3.5.0</org.springframework.boot.version>
</properties>

<dependencyManagement>
Expand Down
8 changes: 4 additions & 4 deletions spring-security-advanced-authentication-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.xdev</groupId>
<artifactId>spring-security-advanced-authentication-ui</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>spring-security-advanced-authentication-ui</name>
Expand Down Expand Up @@ -53,13 +53,13 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.4.5</version>
<version>3.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>3.4.5</version>
<version>3.5.0</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -237,7 +237,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.23.1</version>
<version>10.24.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.WebAttributes;
import org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

// CPD-OFF - Upstream copy

Expand Down Expand Up @@ -369,8 +365,11 @@ protected String renderHeaders(final HttpServletRequest request)
}

protected String renderFormLogin(
final HttpServletRequest request, final boolean loginError, final boolean logoutSuccess,
final String contextPath, final String errorMsg)
final HttpServletRequest request,
final boolean loginError,
final boolean logoutSuccess,
final String contextPath,
final String errorMsg)
{
if(!this.formLoginEnabled)
{
Expand Down Expand Up @@ -485,21 +484,9 @@ protected static String renderSaml2Row(final String contextPath, final String ur

protected String getLoginErrorMessage(final HttpServletRequest request)
{
final HttpSession session = request.getSession(false);
if(session == null)
{
return "Invalid credentials";
}
if(!(session.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION)
instanceof final AuthenticationException exception))
{
return "Invalid credentials";
}
if(!StringUtils.hasText(exception.getMessage()))
{
return "Invalid credentials";
}
return exception.getMessage();
// Was changed in Spring Boot 3.5 to always return the same message
// https://github.com/spring-projects/spring-security/commit/c4b223266c7c4713823634326705b586b47a58c4
return "Invalid credentials";
}

protected String renderHiddenInput(final String name, final String value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
import jakarta.servlet.http.HttpServletResponse;

import org.springframework.core.log.LogMessage;
import org.springframework.http.HttpMethod;
import org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.Assert;

Expand All @@ -41,7 +42,7 @@ public class ExtendableDefaultLogoutPageGeneratingFilter
extends DefaultLogoutPageGeneratingFilter
implements GeneratingFilterFillDataFrom<DefaultLogoutPageGeneratingFilter>, ExtendableDefaultPageGeneratingFilter
{
protected RequestMatcher matcher = new AntPathRequestMatcher("/logout", "GET");
protected RequestMatcher matcher = PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.GET, "/logout");

protected Function<HttpServletRequest, Map<String, String>> resolveHiddenInputs =
request -> Collections.emptyMap();
Expand Down