org.apache.sling.commons.auth.spi.AuthenticationFeedbackHandler Maven / Gradle / Ivy
Show all versions of aem-sdk-api Show documentation
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sling.commons.auth.spi;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* The AuthenticationFeedbackHandler
may be implemented by
* {@link AuthenticationHandler} services to request being informed on the
* success or failure of authentication.
*
* @deprecated Use Apache Sling's org.apache.sling.auth.core.spi package instead.
*/
@Deprecated(since = "2015")
public interface AuthenticationFeedbackHandler {
/**
* Called if authentication failed with the credentials provided in the
* authInfo
map.
*
* This method allows the handler to cleanup any state prepared while
* handling the
* {@link AuthenticationHandler#extractCredentials(HttpServletRequest, HttpServletResponse)
* extractCredentials} method. Handlers are expected to not send a in this
* method because the Sling Authenticator will proceed to select an
* authentication handler whose
* {@link AuthenticationHandler#requestCredentials(HttpServletRequest, HttpServletResponse)
* requestCredentials} method will be called.
*
* @param request The current request
* @param response The current response
* @param authInfo The {@link AuthenticationInfo} object used to
* authenticate the request.
*/
void authenticationFailed(HttpServletRequest request, HttpServletResponse response, AuthenticationInfo authInfo);
/**
* Called if authentication succeeded with the credentials provided in the
* authInfo
map.
*
* This method is called after successful login and impersonation handling
* immediately before continuing with the request. The handler may choose to
* send its own response or to just set some response header (e.g. adding a
* Cookie) and return appropriately.
*
* @param request The current request
* @param response The current response
* @param authInfo The {@link AuthenticationInfo} object used to
* authenticate the request.
* @return true
if the handler sent back a response to the
* client and request processing should be terminated at this point.
* If false
is returned, the request proceeds as
* authenticated.
*/
boolean authenticationSucceeded(HttpServletRequest request, HttpServletResponse response, AuthenticationInfo authInfo);
}