mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 01:02:14 +00:00
Decode cookie once in AbstractRememberMeServices
Issue gh-9192
This commit is contained in:
parent
34a21cd80c
commit
ff58ac836e
@ -208,13 +208,13 @@ public abstract class AbstractRememberMeServices
|
|||||||
for (int j = 0; j < cookieValue.length() % 4; j++) {
|
for (int j = 0; j < cookieValue.length() % 4; j++) {
|
||||||
cookieValue = cookieValue + "=";
|
cookieValue = cookieValue + "=";
|
||||||
}
|
}
|
||||||
|
String cookieAsPlainText;
|
||||||
try {
|
try {
|
||||||
Base64.getDecoder().decode(cookieValue.getBytes());
|
cookieAsPlainText = new String(Base64.getDecoder().decode(cookieValue.getBytes()));
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex) {
|
catch (IllegalArgumentException ex) {
|
||||||
throw new InvalidCookieException("Cookie token was not Base64 encoded; value was '" + cookieValue + "'");
|
throw new InvalidCookieException("Cookie token was not Base64 encoded; value was '" + cookieValue + "'");
|
||||||
}
|
}
|
||||||
String cookieAsPlainText = new String(Base64.getDecoder().decode(cookieValue.getBytes()));
|
|
||||||
String[] tokens = StringUtils.delimitedListToStringArray(cookieAsPlainText, DELIMITER);
|
String[] tokens = StringUtils.delimitedListToStringArray(cookieAsPlainText, DELIMITER);
|
||||||
for (int i = 0; i < tokens.length; i++) {
|
for (int i = 0; i < tokens.length; i++) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user