code:     public Authentication attemptAuthentication(HttpServletRequest request) throws AuthenticationException {
          
          SecurityContext context = SecurityContextHolder.getContext();
          if (context != null) {
              Authentication authentication = context.getAuthentication();
              if (authentication instanceof FederationAuthenticationToken) {
                  // If we reach this point then the token must be expired
                  throw new ExpiredTokenException("Token is expired");
              }
          }
          
          String wa = request.getParameter(FederationConstants.PARAM_ACTION);
          String responseToken = getResponseToken(request);
          FedizRequest wfReq = new FedizRequest();
          wfReq.setAction(wa);
          wfReq.setResponseToken(responseToken);
          wfReq.setState(request.getParameter(SAMLSSOConstants.RELAY_STATE));
          wfReq.setRequest(request);
          
          X509Certificate certs[] = 
              (X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate");
          wfReq.setCerts(certs);
          
          final UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(null, wfReq);
  
          authRequest.setDetails(authenticationDetailsSource.buildDetails(request));
  
          return this.getAuthenticationManager().authenticate(authRequest);
      }
      
      @Override
  