package rabbit.filter.authenticate;

import rabbit.http.HttpHeader;
import rabbit.proxy.Connection;

/** Something that can authenticate users using some kind of database. 
 */
public interface Authenticator {

    /** Find the token used to authenticate */
    String getToken (HttpHeader header, Connection con);

    /** Try to authenticate the user.
     * @param user the username
     * @param pwd the password of the user
     * @return true if authentication succeeded, false otherwise.
     */
    boolean authenticate (String user, String pwd);
}
