public abstract class AuthenticationMethodType extends Object
AuthenticationMethod
objects and for creating the options panels used for configuring both the
AuthenticationMethod
and the AuthenticationCredentials
.
The implementors of new authentication methods should also implement a corresponding AuthenticationMethodType
. The system automatically detects and loads Authentication Method Types
and, through them, the corresponding Authentication methods.
Modifier and Type | Class and Description |
---|---|
static class |
AuthenticationMethodType.UnsupportedAuthenticationMethodException
Thrown when an unsupported type of credentials is used with a
AuthenticationMethod . |
Constructor and Description |
---|
AuthenticationMethodType() |
Modifier and Type | Method and Description |
---|---|
abstract AbstractCredentialsOptionsPanel<? extends AuthenticationCredentials> |
buildCredentialsOptionsPanel(AuthenticationCredentials credentials,
Context uiSharedContext)
Builds the options panel that can be used to fully configure an.
|
abstract AbstractAuthenticationMethodOptionsPanel |
buildOptionsPanel(Context uiSharedContext)
Builds the options panel that can be used to fully configure an authentication method.
|
abstract AuthenticationCredentials |
createAuthenticationCredentials()
Creates a new, empty, Authentication Credentials object corresponding to this type of
Authentication method.
|
abstract AuthenticationMethod |
createAuthenticationMethod(int contextId)
Builds a new, empty, authentication method.
|
boolean |
equals(Object obj) |
abstract void |
exportData(org.apache.commons.configuration.Configuration config,
AuthenticationMethod authMethod)
Export the specified method to the configuration
|
abstract Class<? extends AuthenticationCredentials> |
getAuthenticationCredentialsType()
Gets the type of the authentication credentials that this authentication method creates.
|
abstract String |
getName()
Gets the name of the authentication method.
|
abstract ApiDynamicActionImplementor |
getSetCredentialsForUserApiAction()
Gets the
ApiDynamicActionImplementor that can be used to set the authentication
credentials of the corresponding type for an User of a context. |
abstract ApiDynamicActionImplementor |
getSetMethodForContextApiAction()
Gets the
ApiAction that can be used to set an authentication method of this type for
a context. |
abstract int |
getUniqueIdentifier()
Gets the unique identifier of this Authentication Method Type.
|
abstract boolean |
hasCredentialsOptionsPanel()
Checks if the corresponding
AuthenticationCredentials has an options panel that can
be used for its configuration. |
int |
hashCode() |
abstract boolean |
hasOptionsPanel()
Checks if the corresponding
AuthenticationMethod has an options panel that can be
used for configuration. |
abstract void |
hook(ExtensionHook extensionHook)
Hooks the Authentication Method Type with other components of ZAP, if needed.
|
abstract void |
importData(org.apache.commons.configuration.Configuration config,
AuthenticationMethod authMethod)
Import the method from the configuration
|
abstract boolean |
isTypeForMethod(AuthenticationMethod method)
Checks if is this is a type for the Authentication Method provided as parameter.
|
abstract AuthenticationMethod |
loadMethodFromSession(Session session,
int contextId)
Loads an authentication method from the Session.
|
abstract void |
persistMethodToSession(Session session,
int contextId,
AuthenticationMethod authMethod)
Persists the authentication method to the session.
|
String |
toString() |
public abstract AuthenticationMethod createAuthenticationMethod(int contextId)
contextId
- the ID of the context for which the authentication method is being createdbuildOptionsPanel(Context)
public abstract String getName()
public abstract int getUniqueIdentifier()
public abstract AbstractAuthenticationMethodOptionsPanel buildOptionsPanel(Context uiSharedContext)
This method just builds an empty options panel. For binding an existing method to the
panel, AbstractAuthenticationMethodOptionsPanel.bindMethod(AuthenticationMethod)
should be used.
uiSharedContext
- the shared context on which the panel should workhasOptionsPanel()
public abstract boolean hasOptionsPanel()
AuthenticationMethod
has an options panel that can be
used for configuration.buildOptionsPanel(Context)
public abstract AbstractCredentialsOptionsPanel<? extends AuthenticationCredentials> buildCredentialsOptionsPanel(AuthenticationCredentials credentials, Context uiSharedContext)
credentials
- the credentialsuiSharedContext
- the shared context on which the panel should workAuthenticationCredentials
object.public abstract boolean hasCredentialsOptionsPanel()
AuthenticationCredentials
has an options panel that can
be used for its configuration.public abstract boolean isTypeForMethod(AuthenticationMethod method)
method
- the methodpublic abstract void hook(ExtensionHook extensionHook)
For example, PopupMenus can be registered.
extensionHook
- the extension hookpublic abstract AuthenticationMethod loadMethodFromSession(Session session, int contextId) throws DatabaseException
session
- the sessioncontextId
- the ID of the contextDatabaseException
- if an error occurred while loading the authentication methodpublic abstract void persistMethodToSession(Session session, int contextId, AuthenticationMethod authMethod) throws DatabaseException
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 abstract void exportData(org.apache.commons.configuration.Configuration config, AuthenticationMethod authMethod)
config
- the Configuration
where to export/save the authentication methodauthMethod
- the authentication method to be exportedpublic abstract void importData(org.apache.commons.configuration.Configuration config, AuthenticationMethod authMethod) throws org.apache.commons.configuration.ConfigurationException
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
datapublic abstract AuthenticationCredentials createAuthenticationCredentials()
public abstract Class<? extends AuthenticationCredentials> getAuthenticationCredentialsType()
null
.public abstract ApiDynamicActionImplementor getSetMethodForContextApiAction()
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.
public abstract ApiDynamicActionImplementor getSetCredentialsForUserApiAction()
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.