Class ShibbolethLoginFilter

All Implemented Interfaces:
jakarta.servlet.Filter, Aware, BeanNameAware, DisposableBean, InitializingBean, ApplicationEventPublisherAware, EnvironmentAware, MessageSourceAware, EnvironmentCapable, ServletContextAware

public class ShibbolethLoginFilter extends StatelessLoginFilter
This class will filter Shibboleth requests to see if the user has been authenticated via Shibboleth.

The overall Shibboleth login process is as follows: 1. When Shibboleth plugin is enabled, client/UI receives Shibboleth's absolute URL in WWW-Authenticate header. See ShibAuthentication loginPageURL() method. 2. Client sends the user to that URL when they select Shibboleth authentication. 3. User logs in using Shibboleth 4. If successful, they are redirected by Shibboleth to the path where this Filter is "listening" (that path is passed to Shibboleth as a URL param in step 1) 5. This filter then intercepts the request in order to check for a valid Shibboleth login (see ShibAuthentication.authenticate()) and stores that user info in a JWT. It also saves that JWT in a *temporary* authentication cookie. 6. This filter then looks for a "redirectUrl" param (also a part of the original URL from step 1), and redirects the user to that location (after verifying it's a trusted URL). Usually this is a redirect back to the Client/UI page where the User started. 7. At that point, the client reads the JWT from the Cookie, and sends it back in a request to /api/authn/login, which triggers the server-side to destroy the Cookie and move the JWT into a Header

This Shibboleth Authentication process is tested in AuthenticationRestControllerIT.

Author:
Giuseppe Digilio (giuseppe dot digilio at 4science dot it), Tim Donohue
See Also: