|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.Authenticator
org.pf.security.authentication.AutoAuthenticationManager
public class AutoAuthenticationManager
This manager class is responsible to hold a registry of LocationCredentials
objects. With the method aboutToAccess( URL ) it selects the appropriate
Authenticator from its regestry and sets in as default into the
java.net.Authenticator class. That allows to do automatic authentication for
different (URLs).
Be aware that this code is not thread-safe!
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.net.Authenticator |
---|
Authenticator.RequestorType |
Method Summary | |
---|---|
boolean |
aboutToAccess(String url)
This method must be called to activate the authenticator that provides credentials to be able to access the given URL. |
boolean |
aboutToAccess(URL url)
This method must be called to activate the authenticator that provides credentials to be able to access the given URL. |
AbstractAuthenticator |
getFallbackAuthenticator()
Returns the fallback authenticator which will be called if no credentials can be found in the registered credtentials. |
static AutoAuthenticationManager |
install()
Must be called once, to activate this authentication manager mechanism within the java.net.Authenticator. |
static AutoAuthenticationManager |
instance()
Returns the only instance this class supports (design pattern "Singleton") |
void |
register(String id,
LocationCredentials credentials)
Registers the given location credentials under the specified id. |
LocationCredentials |
remove(String id)
Removes the location credentials registered under the specified key from the registry. |
void |
reset()
Removes all registered credentials and the fallback authenticator. |
void |
setFallbackAuthenticator(AbstractAuthenticator newValue)
Sets the fallback authenticator which will be called if no credentials can be found in the registered credtentials. |
static void |
uninstall()
Can be called to remove this authentication manager from the java.net.Authenticator. |
Methods inherited from class java.net.Authenticator |
---|
requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public AbstractAuthenticator getFallbackAuthenticator()
public void setFallbackAuthenticator(AbstractAuthenticator newValue)
public static AutoAuthenticationManager install()
public static void uninstall()
public static AutoAuthenticationManager instance()
public boolean aboutToAccess(String url)
url
- The URL that might need authentication to be accessed
public boolean aboutToAccess(URL url)
url
- The URL that might need authentication to be accessed
public void register(String id, LocationCredentials credentials)
public LocationCredentials remove(String id)
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |