Add authentication to config servlet

This commit is contained in:
0xboobface 2020-06-07 16:02:27 +02:00
parent e1fb29b7c8
commit 1b75340f74
1 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,18 @@ public class ConfigServlet extends AbstractCtbrecServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// try {
// boolean authenticated = checkAuthentication(req, body(req));
// if (!authenticated) {
// resp.setStatus(SC_UNAUTHORIZED);
// String response = "{\"status\": \"error\", \"msg\": \"HMAC does not match\"}";
// resp.getWriter().write(response);
// return;
// }
// } catch (InvalidKeyException | NoSuchAlgorithmException | IllegalStateException e) {
// throw new ServletException(e);
// }
resp.setStatus(SC_OK);
resp.setContentType("application/json");