Announcement Announcement Module
Collapse
No announcement yet.
how to set authencate of user as false in servlet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to set authencate of user as false in servlet

    Hi Guys,

    I am uisng spring security. I know contextHolder plays vital role in spring security. Also usernamepasswordauthenticationtoken is used to maintain status of user.

    I am using a filter which runs before request reaches springsecurity servlet.

    My case scenerio is I login then on every request i check for certain condition if it dosent meets that condition then i have take user back to login page and revoke his permissions and authenticity.

    My filter is used for many other purpose also hence i have chosen to check for my valid condn in that filter

    So how to deauthenticate a user from a servlet.

    I have tried invalidating a session, getting Usernamepasswordauthenticationtoken and setting its isauthenticated property as false. In this case still user credentials remains active and he continues to be authorized user

    I have also tried using authToken = SecurityContextHolder.getContext().getAuthenticati on(); but in this case i get null


    Any help will be highly appreciated
    Please let me know if i am not clear with my question

  • #2
    Just want to ask the same question.
    Anyone know?

    Thanks!

    Comment

    Working...
    X