in Spring, I need to do additional verification in custom MyUserDetailsService when user login in, and I need the domain name where the user is login from. any idea ?
Here is what worked out from me How do I get the Session Object in Spring?
in Spring, I need to do additional verification in custom MyUserDetailsService when user login in, and I need the domain name where the user is login from. any idea ?
Here is what worked out from me How do I get the Session Object in Spring?
Yon can inject (@Autowired) the HttpServletRequest into your MyUserDetailsService similar to the code below, I believe getRemoteHost() is what you are looking for?
@RestController
public class WebOneController {
@Autowired
private HttpServletRequest request;
@RequestMapping("/")
public String hello() {
return "host " + request.getRemoteHost();
}
}