org.acegisecurity.providers.AuthenticationProvider Maven / Gradle / Ivy
/* Copyright 2004 Acegi Technology Pty Limited
*
* Licensed 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.acegisecurity.providers;
import org.acegisecurity.Authentication;
import org.acegisecurity.AuthenticationException;
/**
* Indicates a class can process a specific {@link
* org.acegisecurity.Authentication} implementation.
*
* @author Ben Alex
* @version $Id: AuthenticationProvider.java,v 1.5 2005/11/17 00:55:49 benalex Exp $
*/
public interface AuthenticationProvider {
//~ Methods ================================================================
/**
* Performs authentication with the same contract as {@link
* org.acegisecurity.AuthenticationManager#authenticate(Authentication)}.
*
* @param authentication the authentication request object.
*
* @return a fully authenticated object including credentials. May return
* null
if the AuthenticationProvider
is
* unable to support authentication of the passed
* Authentication
object. In such a case, the next
* AuthenticationProvider
that supports the presented
* Authentication
class will be tried.
*
* @throws AuthenticationException if authentication fails.
*/
public Authentication authenticate(Authentication authentication)
throws AuthenticationException;
/**
* Returns true
if this AuthenticationProvider
* supports the indicated Authentication
object.
*
*
* Returning true
does not guarantee an
* AuthenticationProvider
will be able to authenticate the
* presented instance of the Authentication
class. It simply
* indicates it can support closer evaluation of it. An
* AuthenticationProvider
can still return null
* from the {@link #authenticate(Authentication)} method to indicate
* another AuthenticationProvider
should be tried.
*
*
*
* Selection of an AuthenticationProvider
capable of
* performing authentication is conducted at runtime the
* ProviderManager
.
*
*
* @return true
if the implementation can more closely
* evaluate the Authentication
class presented
*/
public boolean supports(Class authentication);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy