Guest User

Untitled

a guest
Nov 1st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1.         String apiKey = request.getParameter("api-key");
  2.         String apiUser = request.getParameter("api-user");
  3.         String apiPass = request.getParameter("api-pass");
  4.  
  5.         APIUser user = apiUserFacade.getAPIUser(apiUser, passEncrypted, apiKey);
  6.  
  7.         if (user != null) {
  8.             String action = request.getParameter("action");
  9.         //then do something based on the value of action
  10.         } else {
  11.         //i.e user = null
  12.             HashMap<String, String> resp = new HashMap<String, String>();
  13.             resp.put("response-code", "401");
  14.             resp.put("response-text", "API User not found");
  15.             out.println(Encoder.parse(resp));
  16.         }
Add Comment
Please, Sign In to add comment