Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5636

Form Authentication handler does not redirect to login form with non ROOT context

    XMLWordPrintableJSON

Details

    Description

      When using the form authentication bundle with a servlet context path != ROOT, accessing content requiring authentication redirects you to Sling home page instead of your form because the redirection doesn't contain the context path:

      INFO [qtp1841606468-42] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
      WARN [qtp1841606468-42] org.apache.sling.auth.core.AuthUtil isRedirectValid: Redirect target '/apps/opal/loginNode.html' does not start with servlet context path '/dev'

      Changing the redirection in FormAuthenticationHandler:413 with this worked for me:
      AuthUtil.sendRedirect(request, response, request.getContextPath() + loginForm, params);

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            glucazeau Guillaume Lucazeau
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: