【发布时间】:2019-04-09 06:43:30
【问题描述】:
我在 Spring Boot 中使用主体类来实现身份验证,每次我将凭据发送到登录时,主体对象都设置为 null。
@RequestMapping("/user")
public Principal loginAuthentication(Principal user) {
LOGGER.debug("Request received from frontend to authenticate the user");
try {
LOGGER.debug("In try block to authenticate the user");
LOGGER.debug("Returning the user object to the front end");
return user;
}
catch(Exception e) {
LOGGER.error("An exception occured while trying to authenticate the user: " +e);
LOGGER.error("Returning NULL to front end");
return null;
}
}
【问题讨论】:
标签: spring-boot spring-mvc authentication