no.tornado.brap.auth.AuthenticationProvider Maven / Gradle / Ivy
package no.tornado.brap.auth;
import no.tornado.brap.common.InvocationRequest;
import no.tornado.brap.exception.AuthenticationFailedException;
/**
* Authenticate the user by the supplied invocationRequest. The supplied
* credentials (if any) are available in the credentials
property.
*
* Set the principal by calling AuthenticationContext#setPrincipal
.
*
* The configured AuthorizationProvider can then access the ThreadLocal
* containing the principal from AuthenticationContext#getPrincipal
.
*
* @see AuthenticationNotRequiredAuthenticator
* @see no.tornado.brap.auth.SingleUsernamePasswordAuthenticator
* @see no.tornado.brap.auth.DatabaseUsernamePasswordAuthenticator
* @see no.tornado.brap.auth.AnonymousPrincipal
* @see no.tornado.brap.common.UsernamePasswordPrincipal
*/
public interface AuthenticationProvider {
/**
* The authentication call. Is made from the ProxyServlet
* after an incoming invocation request is made.
*
* If a successful authentication is made, the AuthenticationContext#setPrincipal()
* method is called to update the principal with a spesific object,
* preferably the Credentials object found in the InvocationRequest
.
*
* @param invocationRequest The invocationRequest, possibly containing a credentials
object
*
* @see no.tornado.brap.servlet.ProxyServlet
* @see no.tornado.brap.auth.AuthorizationProvider
* @see AuthenticationContext
* @see no.tornado.brap.common.UsernamePasswordPrincipal
* @see no.tornado.brap.auth.DatabaseUsernamePasswordAuthenticator
*/
void authenticate(InvocationRequest invocationRequest) throws AuthenticationFailedException;
}