org.eclipse.webdav.http.client
Interface IAuthenticator


public interface IAuthenticator

Implementations of this interface are used by clients to store and retrieve information for authentication purposes.

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Method Summary
 void addAuthenticationInfo(URL serverUrl, String realm, String scheme, Map info)
          Adds the given authentication information to the store.
 void addProtectionSpace(URL resourceUrl, String realm)
          Adds the specified resource to the protection space specified by the given realm.
 Map getAuthenticationInfo(URL serverUrl, String realm, String scheme)
          Returns the authentication information for the specified protection space and given authentication scheme.
 String getProtectionSpace(URL resourceUrl)
          Returns the protection space (realm) for the specified resource, or null if the realm is unknown.
 Map requestAuthenticationInfo(URL resourceUrl, String realm, String scheme)
          Returns the authentication information for the specified protection space and given authentication scheme.
 

Method Detail

addAuthenticationInfo

void addAuthenticationInfo(URL serverUrl,
                           String realm,
                           String scheme,
                           Map info)
Adds the given authentication information to the store. The information is relevant for the specified protection space and the given authentication scheme. The protection space is defined by the combination of the given server URL and realm. The authentication scheme determines what the authentication information contains and how it should be used. The authentication information is a Map of String to String and typically contain information such as usernames and passwords.

Parameters:
serverUrl - the URL identifying the server for this authentication information. For example, "http://www.hostname.com/".
realm - the subsection of the given server to which this authentication information applies. For example, "realm1@hostname.com" or "" for no realm.
scheme - the scheme for which this authentication information applies. For example, "Basic" or "" for no authentication scheme
info - a Map containing authentication information such as usernames and passwords

addProtectionSpace

void addProtectionSpace(URL resourceUrl,
                        String realm)
Adds the specified resource to the protection space specified by the given realm. All resources at or deeper than the depth of the last symbolic element in the path of the given resource URL are assumed to be in the same protection space.

Parameters:
resourceUrl - the URL identifying the resources to be added to the specified protection space. For example, "http://www.hostname.com/folder/".
realm - the name of the protection space. For example, "realm1@hostname.com"

getAuthenticationInfo

Map getAuthenticationInfo(URL serverUrl,
                          String realm,
                          String scheme)
Returns the authentication information for the specified protection space and given authentication scheme. The protection space is defined by the given server URL and realm. Returns null if no such information exists.

This method is similar to requestAuthenticationInfo except the user is not prompted for the result. Instead, the store is queried for the information (such as username and password).

Parameters:
serverUrl - the URL identifying the server for the authentication information. For example, "http://www.hostname.com/".
realm - the subsection of the given server to which the authentication information applies. For example, "realm1@hostname.com" or "" for no realm.
scheme - the scheme for which the authentication information applies. For example, "Basic" or "" for no authentication scheme
Returns:
the authentication information for the specified protection space and given authentication scheme, or null if no such information exists
See Also:
requestAuthenticationInfo(URL, String, String)

getProtectionSpace

String getProtectionSpace(URL resourceUrl)
Returns the protection space (realm) for the specified resource, or null if the realm is unknown.

Parameters:
resourceUrl - the URL of the resource whose protection space is returned. For example, "http://www.hostname.com/folder/".
Returns:
the protection space (realm) for the specified resource, or null if the realm is unknown

requestAuthenticationInfo

Map requestAuthenticationInfo(URL resourceUrl,
                              String realm,
                              String scheme)
Returns the authentication information for the specified protection space and given authentication scheme. The protection space is defined by the given server URL and realm. Returns null if no such information exists.

This method is similar to getAuthenticationInfo except the store is usually not queried for the result. Instead, the user is prompted for the information (such as username and password).

Parameters:
resourceUrl - the URL identifying the server for the authentication information. For example, "http://www.hostname.com/".
realm - the subsection of the given server to which the authentication information applies. For example, "realm1@hostname.com" or "" for no realm.
scheme - the scheme for which the authentication information applies. For example, "Basic" or "" for no authentication scheme
Returns:
the authentication information for the specified protection space and given authentication scheme, or null if no such information exists
See Also:
getAuthenticationInfo(URL, String, String)


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.