comparison gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java @ 8203:238fc722f87a

sed 's/logger/log/g' src/**/*.java
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 13:19:22 +0200
parents 7bc35bbd8b27
children 5aff82e77ec3
comparison
equal deleted inserted replaced
8202:e4606eae8ea5 8203:238fc722f87a
28 import org.dive4elements.river.client.server.features.Features; 28 import org.dive4elements.river.client.server.features.Features;
29 29
30 30
31 public class SamlServlet extends AuthenticationServlet { 31 public class SamlServlet extends AuthenticationServlet {
32 32
33 private static Logger logger = Logger.getLogger(SamlServlet.class); 33 private static Logger log = Logger.getLogger(SamlServlet.class);
34 34
35 @Override 35 @Override
36 protected void doPost(HttpServletRequest req, HttpServletResponse resp) 36 protected void doPost(HttpServletRequest req, HttpServletResponse resp)
37 throws ServletException, IOException 37 throws ServletException, IOException
38 { 38 {
39 String encoding = req.getCharacterEncoding(); 39 String encoding = req.getCharacterEncoding();
40 String samlTicketXML = req.getParameter("saml"); 40 String samlTicketXML = req.getParameter("saml");
41 41
42 logger.debug("Processing post request"); 42 log.debug("Processing post request");
43 43
44 if (samlTicketXML == null) { 44 if (samlTicketXML == null) {
45 logger.debug("No saml ticket provided"); 45 log.debug("No saml ticket provided");
46 this.redirectFailure(resp, req.getContextPath()); 46 this.redirectFailure(resp, req.getContextPath());
47 return; 47 return;
48 } 48 }
49 49
50 try { 50 try {
51 User user = this.auth(samlTicketXML); 51 User user = this.auth(samlTicketXML);
52 if (user == null) { 52 if (user == null) {
53 logger.debug("Authentication not successful"); 53 log.debug("Authentication not successful");
54 this.redirectFailure(resp, req.getContextPath()); 54 this.redirectFailure(resp, req.getContextPath());
55 return; 55 return;
56 } 56 }
57 this.performLogin(req, resp, user); 57 this.performLogin(req, resp, user);
58 } 58 }
59 catch(AuthenticationException e) { 59 catch(AuthenticationException e) {
60 logger.error(e, e); 60 log.error(e, e);
61 this.redirectFailure(resp, req.getContextPath(), e); 61 this.redirectFailure(resp, req.getContextPath(), e);
62 } 62 }
63 } 63 }
64 64
65 private User auth(String samlTicketXML) 65 private User auth(String samlTicketXML)
76 76
77 InputStream in = new StringBufferInputStream(samlTicketXML); 77 InputStream in = new StringBufferInputStream(samlTicketXML);
78 assertion = validator.checkTicket(new Base64InputStream(in)); 78 assertion = validator.checkTicket(new Base64InputStream(in));
79 } 79 }
80 catch (Exception e) { 80 catch (Exception e) {
81 logger.error(e.getLocalizedMessage(), e); 81 log.error(e.getLocalizedMessage(), e);
82 } 82 }
83 if (assertion == null) { 83 if (assertion == null) {
84 throw new AuthenticationException("Login failed."); 84 throw new AuthenticationException("Login failed.");
85 } 85 }
86 86

http://dive4elements.wald.intevation.org