|
|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
package org.leolo.nrapi.web; |
|
|
|
|
|
|
|
|
|
import org.leolo.nrapi.util.HttpReqRespUtils; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
|
@ -10,12 +13,17 @@ import javax.servlet.http.HttpSession;
|
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping(value = "web/auth") |
|
|
|
|
public class LoginAPI { |
|
|
|
|
|
|
|
|
|
private Logger log = LoggerFactory.getLogger(LoginAPI.class); |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "login", method = RequestMethod.POST) |
|
|
|
|
public Object doLogin( |
|
|
|
|
@RequestParam(name="username", required = true) String userName, |
|
|
|
|
@RequestParam(name="password", required = true) String password, |
|
|
|
|
HttpSession session |
|
|
|
|
){ |
|
|
|
|
String reqIP = HttpReqRespUtils.getClientIpAddressIfServletRequestExist(); |
|
|
|
|
log.info("Login request from {}, username is {}, password length = {}", reqIP, userName, password.length()); |
|
|
|
|
return new Object(){ |
|
|
|
|
public String getStatus(){return "failed";} |
|
|
|
|
public String getMessage() {return "Not implemented";} |
|
|
|
|
|