Skip to content

Commit ed3af64

Browse files
palakovajzheaux
authored andcommitted
Fix SAML logout log messages
Fixes SAML logout log messages incorrectly referring to logout response instead of logout request and vice versa. Closes gh-12129
1 parent fde26e0 commit ed3af64

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/authentication/logout/OpenSamlLogoutRequestValidator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private Consumer<Collection<Saml2Error>> validateIssuer(LogoutRequest request,
126126
RelyingPartyRegistration registration) {
127127
return (errors) -> {
128128
if (request.getIssuer() == null) {
129-
errors.add(new Saml2Error(Saml2ErrorCodes.INVALID_ISSUER, "Failed to find issuer in LogoutResponse"));
129+
errors.add(new Saml2Error(Saml2ErrorCodes.INVALID_ISSUER, "Failed to find issuer in LogoutRequest"));
130130
return;
131131
}
132132
String issuer = request.getIssuer().getValue();
@@ -142,7 +142,7 @@ private Consumer<Collection<Saml2Error>> validateDestination(LogoutRequest reque
142142
return (errors) -> {
143143
if (request.getDestination() == null) {
144144
errors.add(new Saml2Error(Saml2ErrorCodes.INVALID_DESTINATION,
145-
"Failed to find destination in LogoutResponse"));
145+
"Failed to find destination in LogoutRequest"));
146146
return;
147147
}
148148
String destination = request.getDestination();

saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/authentication/logout/Saml2LogoutResponseFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
114114
logoutRequest.getRelyingPartyRegistrationId());
115115
if (registration == null) {
116116
this.logger
117-
.trace("Did not process logout request since failed to find associated RelyingPartyRegistration");
117+
.trace("Did not process logout response since failed to find associated RelyingPartyRegistration");
118118
Saml2Error error = new Saml2Error(Saml2ErrorCodes.RELYING_PARTY_REGISTRATION_NOT_FOUND,
119119
"Failed to find associated RelyingPartyRegistration");
120120
response.sendError(HttpServletResponse.SC_BAD_REQUEST, error.toString());

0 commit comments

Comments
 (0)