001package org.tynamo.security;
002
003import java.util.Collection;
004
005import org.apache.shiro.realm.Realm;
006
007/**
008 * Replacement for Shiro's Authenticator interface while waiting for https://issues.apache.org/jira/browse/SHIRO-233 to be
009 * satisfactorily resolved
010 *
011 */
012public interface Authenticator extends org.apache.shiro.authc.Authenticator, AuthenticationListenerRegistrar {
013  /**
014   * Sets all realms used by this Authenticator, providing PAM (Pluggable Authentication Module) configuration. 
015   * 
016   * The operation is copied from org.apache.shiro.authc.pam.ModularRealmAuthenticator. Shiro's design is less than ideal for proxied 
017   * interface-based systems because it internally relies on downcasting to specific types. Not all Authenticators need realms but 
018   * ModularRealmAuthenticator has its own reference to the realms collection (separate from securityManager) so make the setter 
019   * available here.
020   *
021   * @param realms the realms to consult during authentication attempts.
022   */
023  public void setRealms(Collection<Realm> realms);
024}