perfsonar-dev - [GEANT/SA2/ps-java-services] r5658 - trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets
Subject: perfsonar development work
List archive
[GEANT/SA2/ps-java-services] r5658 - trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets
Chronological Thread
- From:
- To:
- Subject: [GEANT/SA2/ps-java-services] r5658 - trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets
- Date: Wed, 19 May 2010 14:55:26 +0100
Author: psnc.trzaszczka
Date: 2010-05-19 14:55:26 +0100 (Wed, 19 May 2010)
New Revision: 5658
Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
Log:
Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
2010-05-19 13:40:24 UTC (rev 5657)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
2010-05-19 13:55:26 UTC (rev 5658)
@@ -7,6 +7,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
import org.perfsonar.base2.service.configuration.ConfigurationManager;
import org.perfsonar.base2.service.exceptions.PerfSONARException;
@@ -20,8 +21,8 @@
@SuppressWarnings("serial")
public abstract class AuthServlet extends HttpServlet {
- private Logger logger=Logger.getLogger(AuthServlet.class);
-
+ private Logger logger = Logger.getLogger(AuthServlet.class);
+
private String username;
private String password;
@@ -88,18 +89,14 @@
if (basic.equalsIgnoreCase("Basic")) {
String credentials = st.nextToken();
- sun.misc.BASE64Decoder decoder = new
sun.misc.BASE64Decoder();
String userPass;
- try {
- userPass = new
String(decoder.decodeBuffer(credentials));
- int p = userPass.indexOf(":");
- if (p != -1) {
- loginAndPassword =
new String[2];
- loginAndPassword[0] =
userPass.substring(0, p);
- loginAndPassword[1] =
userPass.substring(p + 1);
- }
- } catch (IOException e) {
- e.printStackTrace();
+ userPass = new String(new
String(Base64
+
.decodeBase64(credentials.getBytes())));
+ int p = userPass.indexOf(":");
+ if (p != -1) {
+ loginAndPassword = new
String[2];
+ loginAndPassword[0] =
userPass.substring(0, p);
+ loginAndPassword[1] =
userPass.substring(p + 1);
}
}
- [GEANT/SA2/ps-java-services] r5658 - trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets, svn-noreply, 05/19/2010
Archive powered by MHonArc 2.6.16.