O'Reilly logo

Spring Security 3.x Cookbook by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logging out with JSF using Spring Security

In this section, we will implement the logging out scenario using Spring Security in a JSF application.

Getting ready

  • Implement the PhaseListener class
  • Add a commandButton on the JSF page

How to do it...

Perform the following steps for implementing Spring Security logout in a JSF application:

  1. Create a New Dynamic Web Project in your Eclipse:
    How to do it...
  2. We will create a CredentialManager bean again. It will have another custom logout method. Login.jsp remains the same as the previous example. Do not forget to copy it into the new project. We will use form-based authentication here:
    package com.packt.jsf.beans; import java.io.IOException; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required