public interface ContextFactory
AuthScheme.createContextFactory(uk.ac.starlink.auth.Challenge, java.net.URL)
Modifier and Type | Method and Description |
---|---|
AuthContext |
createContext(UserInterface ui)
Attempts to create an authentication context, by enquiring for
input from the UI as appropriate.
|
AuthContext |
createUnauthContext()
Creates a context representing unauthenticated (anonymous) access.
|
AuthContext createContext(UserInterface ui)
AuthContext.hasCredentials()
will return true),
or null if the user declined to authenticate.
If appropriate, the implementation of this method should offer
the user retry attempts following failed or inadequate credential
entry in accordance with the supplied UserInterface.
Note however that retries must not be attempted
if UserInterface.canRetry()
returns false or
following a null return from UserInterface.readUserPassword(java.lang.String[])
.
ui
- user interface that can be used to query the user
for credentialsAuthContext createUnauthContext()
AuthContext.hasCredentials()
will return false, may or may not be capable of connecting,
but it can represent the choice of a user not to authenticate for
a given challenge.