\n");
if (this.formLoginEnabled) {
- sb.append("
\n");
}
if (this.oauth2LoginEnabled) {
- sb.append("
");
+ sb.append("
Login with OAuth 2.0 ");
sb.append(createError(loginError, errorMsg));
sb.append(createLogoutSuccess(logoutSuccess));
sb.append("
\n");
@@ -244,7 +242,7 @@ private String generateLoginPageHtml(HttpServletRequest request, boolean loginEr
sb.append("
\n");
}
if (this.saml2LoginEnabled) {
- sb.append("
");
+ sb.append("
Login with SAML 2.0 ");
sb.append(createError(loginError, errorMsg));
sb.append(createLogoutSuccess(logoutSuccess));
sb.append("
\n");
diff --git a/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java b/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java
index 29f4b3d5d5f..9c38b8cb5e5 100644
--- a/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java
+++ b/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.core.log.LogMessage;
+import org.springframework.security.web.util.CssUtils;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.Assert;
@@ -69,19 +70,15 @@ private void renderLogout(HttpServletRequest request, HttpServletResponse respon
sb.append(" \n");
sb.append(" \n");
sb.append(" Confirm Log Out? \n");
- sb.append(" \n");
- sb.append(" \n");
+ sb.append(CssUtils.getCssStyleBlock().indent(4));
sb.append(" \n");
sb.append(" \n");
- sb.append(" \n");
- sb.append(" \n");
sb.append("
\n");
sb.append(" \n");
diff --git a/web/src/main/java/org/springframework/security/web/server/ui/LoginPageGeneratingWebFilter.java b/web/src/main/java/org/springframework/security/web/server/ui/LoginPageGeneratingWebFilter.java
index 2b85e897324..3065796ea4e 100644
--- a/web/src/main/java/org/springframework/security/web/server/ui/LoginPageGeneratingWebFilter.java
+++ b/web/src/main/java/org/springframework/security/web/server/ui/LoginPageGeneratingWebFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
import org.springframework.security.web.server.csrf.CsrfToken;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatchers;
+import org.springframework.security.web.util.CssUtils;
import org.springframework.util.Assert;
import org.springframework.util.MultiValueMap;
import org.springframework.web.server.ServerWebExchange;
@@ -97,14 +98,10 @@ private byte[] createPage(ServerWebExchange exchange, String csrfTokenHtmlInput)
page.append(" \n");
page.append(" \n");
page.append(" Please sign in \n");
- page.append(" \n");
- page.append(" \n");
+ page.append(CssUtils.getCssStyleBlock().indent(4));
page.append(" \n");
page.append(" \n");
- page.append(" \n");
+ page.append("
\n");
page.append(formLogin(queryParams, contextPath, csrfTokenHtmlInput));
page.append(oauth2LoginLinks(queryParams, contextPath, this.oauth2AuthenticationUrlToClientName));
page.append("
\n");
@@ -120,21 +117,21 @@ private String formLogin(MultiValueMap
queryParams, String conte
boolean isError = queryParams.containsKey("error");
boolean isLogoutSuccess = queryParams.containsKey("logout");
StringBuilder page = new StringBuilder();
- page.append(" \n");
return page.toString();
}
@@ -146,7 +143,7 @@ private static String oauth2LoginLinks(MultiValueMap queryParams
}
boolean isError = queryParams.containsKey("error");
StringBuilder sb = new StringBuilder();
- sb.append("");
+ sb.append("
Login with OAuth 2.0 ");
sb.append(createError(isError));
sb.append("
\n");
for (Map.Entry clientAuthenticationUrlToClientName : oauth2AuthenticationUrlToClientName
diff --git a/web/src/main/java/org/springframework/security/web/server/ui/LogoutPageGeneratingWebFilter.java b/web/src/main/java/org/springframework/security/web/server/ui/LogoutPageGeneratingWebFilter.java
index b8ad98cd29d..a691e2fdcbb 100644
--- a/web/src/main/java/org/springframework/security/web/server/ui/LogoutPageGeneratingWebFilter.java
+++ b/web/src/main/java/org/springframework/security/web/server/ui/LogoutPageGeneratingWebFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@
import org.springframework.security.web.server.csrf.CsrfToken;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatchers;
+import org.springframework.security.web.util.CssUtils;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;
@@ -78,17 +79,14 @@ private static byte[] createPage(String csrfTokenHtmlInput, String contextPath)
page.append(" \n");
page.append(" \n");
page.append(" Confirm Log Out? \n");
- page.append(" \n");
- page.append(" \n");
+ page.append(CssUtils.getCssStyleBlock().indent(4));
page.append(" \n");
page.append(" \n");
- page.append("