AuthenticationFeedbackHandlerBridge.java 2 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.servlet.http.HttpServletRequest
 *  javax.servlet.http.HttpServletResponse
 *  org.apache.sling.auth.core.spi.AuthenticationFeedbackHandler
 *  org.apache.sling.auth.core.spi.AuthenticationInfo
 */
package com.day.cq.compat.commonsauth.impl;

import com.day.cq.compat.commonsauth.impl.AuthenticationHandlerBridge;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.sling.auth.core.spi.AuthenticationInfo;
import org.apache.sling.commons.auth.spi.AuthenticationFeedbackHandler;
import org.apache.sling.commons.auth.spi.AuthenticationHandler;

public class AuthenticationFeedbackHandlerBridge
extends AuthenticationHandlerBridge
implements org.apache.sling.auth.core.spi.AuthenticationFeedbackHandler {
    AuthenticationFeedbackHandlerBridge(AuthenticationHandler delegatee) {
        super(delegatee);
    }

    public void authenticationFailed(HttpServletRequest request, HttpServletResponse response, AuthenticationInfo authInfo) {
        this.getFeedbackHandler().authenticationFailed(request, response, AuthenticationFeedbackHandlerBridge.toInterimAuthInfo(authInfo));
    }

    public boolean authenticationSucceeded(HttpServletRequest request, HttpServletResponse response, AuthenticationInfo authInfo) {
        return this.getFeedbackHandler().authenticationSucceeded(request, response, AuthenticationFeedbackHandlerBridge.toInterimAuthInfo(authInfo));
    }

    AuthenticationFeedbackHandler getFeedbackHandler() {
        return (AuthenticationFeedbackHandler)((Object)this.getDelegatee());
    }

    private static org.apache.sling.commons.auth.spi.AuthenticationInfo toInterimAuthInfo(AuthenticationInfo authInfo) {
        org.apache.sling.commons.auth.spi.AuthenticationInfo interimAuthInfo = new org.apache.sling.commons.auth.spi.AuthenticationInfo(authInfo.getAuthType());
        interimAuthInfo.putAll(authInfo);
        return interimAuthInfo;
    }
}