[AMQ-9235] Convert activemq-web to use j.util.Base64

This commit is contained in:
Matt Pavlovich 2023-10-07 08:03:53 -05:00
parent e7f023ce8b
commit 33ceb9fe8a
2 changed files with 2 additions and 5 deletions

View File

@ -58,10 +58,6 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>activemq-unit-tests</artifactId>

View File

@ -22,6 +22,7 @@ import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -385,7 +386,7 @@ public class WebClient implements HttpSessionActivationListener, HttpSessionBind
String[] tokens = auth.split(" ");
if (tokens.length == 2) {
String encoded = tokens[1].trim();
String credentials = new String(javax.xml.bind.DatatypeConverter.parseBase64Binary(encoded));
String credentials = new String(Base64.getDecoder().decode(encoded));
String[] creds = credentials.split(":");
if (creds.length == 2) {
client.setUsername(creds[0]);