Spring Security [Spring Boot App] : How to block a user? -
my project on employee exit process , once employee relieved, expected block employee logging in and not delete employee.
attempts:
userobject.iscredentialsnonexpired() = false
userobject.isaccountnonlocked() = false
userobject.isaccountnonexpired() = false
userobject.isenabled() = false
even when modify these 4 values, login still works user.
@autowired employeerepository emprep; @override public employeeentity loaduserbyusername(string username) throws usernamenotfoundexception { employeeentity emp = emprep.findbyuserid(username); if (emp == null) { throw new usernamenotfoundexception("user trapped in singularity"); } return emp; }
Comments
Post a Comment