Class ShibbolethRestController

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean

    @RequestMapping("/api/authn/shibboleth")
    @RestController
    public class ShibbolethRestController
    extends Object
    implements org.springframework.beans.factory.InitializingBean
    Rest controller that handles redirect *after* shibboleth authentication succeeded.

    Shibboleth authentication does NOT occur in this Controller, but occurs before this class is called. The general 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 this Controller (the path of this controller is passed to Shibboleth as a URL param in step 1) 5. NOTE: Prior to hitting this Controller, ShibbolethAuthenticationFilter briefly intercepts the request in order to check for a valid Shibboleth login (see ShibAuthentication.authenticate()) and store that user info in a JWT. 6. This Controller then gets the request & 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.

    Author:
    Andrea Bollini (andrea dot bollini at 4science dot it), Giuseppe Digilio (giuseppe dot digilio at 4science dot it)
    See Also:
    ShibAuthentication, ShibbolethAuthenticationFilter
    • Constructor Detail

      • ShibbolethRestController

        public ShibbolethRestController()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • shibboleth

        @RequestMapping(method=GET)
        public void shibboleth​(javax.servlet.http.HttpServletResponse response,
                               @RequestParam(name="redirectUrl",required=false)
                               String redirectUrl)
                        throws IOException
        Throws:
        IOException