public class HttpAuthenticationMethodType extends AuthenticationMethodType
AuthenticationMethodType
where the Users are authenticated
through HTTP Authentication.Modifier and Type | Class and Description |
---|---|
static class |
HttpAuthenticationMethodType.HttpAuthenticationMethod
The implementation for an
AuthenticationMethodType where the Users are authenticated
through HTTP Authentication. |
AuthenticationMethodType.UnsupportedAuthenticationMethodException
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_CONFIG_AUTH_HTTP |
static String |
CONTEXT_CONFIG_AUTH_HTTP_HOSTNAME |
static String |
CONTEXT_CONFIG_AUTH_HTTP_PORT |
static String |
CONTEXT_CONFIG_AUTH_HTTP_REALM |
NULL_ENCODER
Constructor and Description |
---|
HttpAuthenticationMethodType() |
Modifier and Type | Method and Description |
---|---|
AbstractCredentialsOptionsPanel<? extends AuthenticationCredentials> |
buildCredentialsOptionsPanel(AuthenticationCredentials credentials,
Context uiSharedContext)
Builds the options panel that can be used to fully configure an.
|
AbstractAuthenticationMethodOptionsPanel |
buildOptionsPanel(Context uiSharedContext)
Builds the options panel that can be used to fully configure an authentication method.
|
AuthenticationCredentials |
createAuthenticationCredentials()
Creates a new, empty, Authentication Credentials object corresponding to this type of
Authentication method.
|
HttpAuthenticationMethodType.HttpAuthenticationMethod |
createAuthenticationMethod(int contextId)
Builds a new, empty, authentication method.
|
void |
exportData(org.apache.commons.configuration.Configuration config,
AuthenticationMethod authMethod)
Export the specified method to the configuration
|
Class<UsernamePasswordAuthenticationCredentials> |
getAuthenticationCredentialsType()
Gets the type of the authentication credentials that this authentication method creates.
|
String |
getName()
Gets the name of the authentication method.
|
ApiDynamicActionImplementor |
getSetCredentialsForUserApiAction()
Gets the
ApiDynamicActionImplementor that can be used to set the authentication
credentials of the corresponding type for an User of a context. |
ApiDynamicActionImplementor |
getSetMethodForContextApiAction()
Gets the
ApiAction that can be used to set an authentication method of this type for
a context. |
int |
getUniqueIdentifier()
Gets the unique identifier of this Authentication Method Type.
|
boolean |
hasCredentialsOptionsPanel()
Checks if the corresponding
AuthenticationCredentials has an options panel that can
be used for its configuration. |
boolean |
hasOptionsPanel()
Checks if the corresponding
AuthenticationMethod has an options panel that can be
used for configuration. |
void |
hook(ExtensionHook extensionHook)
Hooks the Authentication Method Type with other components of ZAP, if needed.
|
void |
importData(org.apache.commons.configuration.Configuration config,
AuthenticationMethod authMethod)
Import the method from the configuration
|
boolean |
isTypeForMethod(AuthenticationMethod method)
Checks if is this is a type for the Authentication Method provided as parameter.
|
AuthenticationMethod |
loadMethodFromSession(Session session,
int contextId)
Loads an authentication method from the Session.
|
void |
persistMethodToSession(Session session,
int contextId,
AuthenticationMethod authMethod)
Persists the authentication method to the session.
|
equals, hashCode, toString
public static final String CONTEXT_CONFIG_AUTH_HTTP
public static final String CONTEXT_CONFIG_AUTH_HTTP_HOSTNAME
public static final String CONTEXT_CONFIG_AUTH_HTTP_REALM
public static final String CONTEXT_CONFIG_AUTH_HTTP_PORT
public HttpAuthenticationMethodType.HttpAuthenticationMethod createAuthenticationMethod(int contextId)
AuthenticationMethodType
createAuthenticationMethod
in class AuthenticationMethodType
contextId
- the ID of the context for which the authentication method is being createdAuthenticationMethodType.buildOptionsPanel(Context)
public String getName()
AuthenticationMethodType
getName
in class AuthenticationMethodType
public int getUniqueIdentifier()
AuthenticationMethodType
getUniqueIdentifier
in class AuthenticationMethodType
public AbstractAuthenticationMethodOptionsPanel buildOptionsPanel(Context uiSharedContext)
AuthenticationMethodType
This method just builds an empty options panel. For binding an existing method to the
panel, AbstractAuthenticationMethodOptionsPanel.bindMethod(AuthenticationMethod)
should be used.
buildOptionsPanel
in class AuthenticationMethodType
uiSharedContext
- the shared context on which the panel should workAuthenticationMethodType.hasOptionsPanel()
public boolean hasOptionsPanel()
AuthenticationMethodType
AuthenticationMethod
has an options panel that can be
used for configuration.hasOptionsPanel
in class AuthenticationMethodType
AuthenticationMethodType.buildOptionsPanel(Context)
public AbstractCredentialsOptionsPanel<? extends AuthenticationCredentials> buildCredentialsOptionsPanel(AuthenticationCredentials credentials, Context uiSharedContext)
AuthenticationMethodType
buildCredentialsOptionsPanel
in class AuthenticationMethodType
credentials
- the credentialsuiSharedContext
- the shared context on which the panel should workAuthenticationCredentials
object.public boolean hasCredentialsOptionsPanel()
AuthenticationMethodType
AuthenticationCredentials
has an options panel that can
be used for its configuration.hasCredentialsOptionsPanel
in class AuthenticationMethodType
public boolean isTypeForMethod(AuthenticationMethod method)
AuthenticationMethodType
isTypeForMethod
in class AuthenticationMethodType
method
- the methodpublic void hook(ExtensionHook extensionHook)
AuthenticationMethodType
For example, PopupMenus can be registered.
hook
in class AuthenticationMethodType
extensionHook
- the extension hookpublic AuthenticationMethod loadMethodFromSession(Session session, int contextId) throws DatabaseException
AuthenticationMethodType
loadMethodFromSession
in class AuthenticationMethodType
session
- the sessioncontextId
- the ID of the contextDatabaseException
- if an error occurred while loading the authentication methodpublic void persistMethodToSession(Session session, int contextId, AuthenticationMethod authMethod) throws AuthenticationMethodType.UnsupportedAuthenticationMethodException, DatabaseException
AuthenticationMethodType
persistMethodToSession
in class AuthenticationMethodType
session
- the sessioncontextId
- the context idauthMethod
- the auth method to persistAuthenticationMethodType.UnsupportedAuthenticationMethodException
- the unsupported authentication method
exceptionDatabaseException
- if an error occurred while persisting the authentication methodpublic AuthenticationCredentials createAuthenticationCredentials()
AuthenticationMethodType
createAuthenticationCredentials
in class AuthenticationMethodType
public Class<UsernamePasswordAuthenticationCredentials> getAuthenticationCredentialsType()
AuthenticationMethodType
getAuthenticationCredentialsType
in class AuthenticationMethodType
null
.public ApiDynamicActionImplementor getSetMethodForContextApiAction()
AuthenticationMethodType
ApiAction
that can be used to set an authentication method of this type for
a context.
This api action will be handled by executing the ApiDynamicActionImplementor.handleAction(JSONObject)
method.
getSetMethodForContextApiAction
in class AuthenticationMethodType
public ApiDynamicActionImplementor getSetCredentialsForUserApiAction()
AuthenticationMethodType
ApiDynamicActionImplementor
that can be used to set the authentication
credentials of the corresponding type for an User
of a context.
This api action will be handled by executing the ApiDynamicActionImplementor.handleAction(JSONObject)
method.
getSetCredentialsForUserApiAction
in class AuthenticationMethodType
public void exportData(org.apache.commons.configuration.Configuration config, AuthenticationMethod authMethod)
AuthenticationMethodType
exportData
in class AuthenticationMethodType
config
- the Configuration
where to export/save the authentication methodauthMethod
- the authentication method to be exportedpublic void importData(org.apache.commons.configuration.Configuration config, AuthenticationMethod authMethod) throws org.apache.commons.configuration.ConfigurationException
AuthenticationMethodType
importData
in class AuthenticationMethodType
config
- the Configuration
from where to import/load the authentication methodauthMethod
- where to set the imported authentication method dataorg.apache.commons.configuration.ConfigurationException
- if an error occurred while reading the authentication method
data