Skip to content

Commit

Permalink
Auth request parameter name "sessionId" -> "session_id".
Browse files Browse the repository at this point in the history
  • Loading branch information
mpartel committed Sep 24, 2012
1 parent 17c0074 commit 9f43376
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private boolean authenticateFrontend(String serverBaseUrl, String username, Stri
if (password != null) {
data += "&password=" + Resty.enc(password);
} else {
data += "&sessionId=" + Resty.enc(sessionId);
data += "&session_id=" + Resty.enc(sessionId);
}
FormContent formContent = Resty.form(data);
String response = new Resty().text(authUrl, formContent).toString().trim();
Expand Down
12 changes: 8 additions & 4 deletions src/test/java/fi/helsinki/cs/tmc/comet/StubAuthServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
if (baseRequest.getPathInfo() != null && pathInfo.equals("/foo/auth.text")) {
boolean userOk = false;

if (request.getParameter("password") != null) {
userOk = userExists(request.getParameter("username"), request.getParameter("password"));
} else if (request.getParameter("sessionId") != null) {
userOk = sessionIsValid(request.getParameter("username"), request.getParameter("sessionId"));
String username = request.getParameter("username");
String password = request.getParameter("password");
String sessionId = request.getParameter("session_id");

if (password != null) {
userOk = userExists(username, password);
} else if (sessionId != null) {
userOk = sessionIsValid(username, sessionId);
}

response.setContentType("text/plain; charset=utf-8");
Expand Down

0 comments on commit 9f43376

Please sign in to comment.