AuthenticationFormServlet.java 1.5 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.servlet.Servlet
 *  javax.servlet.http.HttpServletRequest
 *  org.apache.felix.scr.annotations.Component
 *  org.apache.felix.scr.annotations.Property
 *  org.apache.felix.scr.annotations.Service
 *  org.apache.sling.auth.core.spi.AbstractAuthenticationFormServlet
 */
package com.day.cq.auth.impl;

import javax.servlet.Servlet;
import javax.servlet.http.HttpServletRequest;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.auth.core.spi.AbstractAuthenticationFormServlet;

@Component
@Property(name="service.description", value={"Default Login Form for CQ Login Selector Authentication Handler"})
@Service(value={Servlet.class})
public class AuthenticationFormServlet
extends AbstractAuthenticationFormServlet {
    @Property(name="sling.servlet.paths")
    static final String SERVLET_PATH = "/system/sling/cqform/defaultlogin";
    @Property(name="sling.auth.requirements")
    private static final String AUTH_REQUIREMENT = "-/system/sling/cqform/defaultlogin";

    protected String getReason(HttpServletRequest request) {
        Object resObj = request.getAttribute("j_reason");
        if (resObj != null) {
            return resObj.toString();
        }
        String reason = request.getParameter("j_reason");
        if (reason != null) {
            return reason;
        }
        return "";
    }
}