1
0
mirror of synced 2026-08-03 08:51:58 +00:00

Set charset of BasicAuthenticationFilter converter

Allow BasicAuthenticationFilter to pick up the given credentials charset.

Fixes: gh-7835
This commit is contained in:
Peter Keller
2020-01-23 15:34:35 +01:00
committed by Eleftheria Stein
parent 630eb10704
commit 2dbedf7af5
2 changed files with 107 additions and 1 deletions
@@ -17,6 +17,7 @@
package org.springframework.security.web.authentication.www;
import java.io.IOException;
import java.nio.charset.Charset;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
@@ -276,6 +277,7 @@ public class BasicAuthenticationFilter extends OncePerRequestFilter {
public void setCredentialsCharset(String credentialsCharset) {
Assert.hasText(credentialsCharset, "credentialsCharset cannot be null or empty");
this.credentialsCharset = credentialsCharset;
this.authenticationConverter.setCredentialsCharset(Charset.forName(credentialsCharset));
}
protected String getCredentialsCharset(HttpServletRequest httpRequest) {