@Extensible @BrokerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class IdentityAuthenticator extends java.lang.Object implements UnboundIDExtension, Configurable, ExampleUsageProvider
In order to configure an Identity Authenticator created using this API, use a command like:
dsconfig create-identity-authenticator \ ---authenticator-name "{name}" \ --type third-party \ --set "extension-class:{class-name}" \ --set "extension-argument:{name=value}"where "{name}" is the name to use for the Identity Authenticator instance, "{class-name}" is the fully-qualified name of the Java class that extends
com.unboundid.directory.sdk.broker.api.IdentityAuthenticator
,
and "{name=value}" represents name-value pairs for any arguments to
provide to the Identity Authenticator. If multiple arguments should be
provided to the extension, then the
"--set extension-argument:{name=value}
" option should be
provided multiple times.Constructor and Description |
---|
IdentityAuthenticator()
Creates a new instance of this Identity Authenticator.
|
Modifier and Type | Method and Description |
---|---|
abstract AuthenticationResult |
authenticate(AuthenticationRequest request)
Process an authentication request.
|
void |
defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments
which may be used by this extension.
|
void |
finalizeAuthenticator()
This hook is called when the Identity Authenticator is disabled or the
server shuts down.
|
java.util.Map<java.util.List<java.lang.String>,java.lang.String> |
getExamplesArgumentSets()
Retrieves a map containing examples of configurations that may be used for
this extension.
|
abstract java.lang.String[] |
getExtensionDescription()
Retrieves a human-readable description for this extension.
|
abstract java.lang.String |
getExtensionName()
Retrieves a human-readable name for this extension.
|
abstract StatusResult |
getStatus(StatusRequest request)
Process a status request.
|
void |
initializeAuthenticator(BrokerContext serverContext,
IdentityAuthenticatorConfig config,
com.unboundid.util.args.ArgumentParser parser)
Initializes this Identity Authenticator.
|
public IdentityAuthenticator()
initializeAuthenticator(com.unboundid.directory.sdk.broker.types.BrokerContext, com.unboundid.directory.sdk.broker.config.IdentityAuthenticatorConfig, com.unboundid.util.args.ArgumentParser)
method.public abstract java.lang.String getExtensionName()
getExtensionName
in interface UnboundIDExtension
public abstract java.lang.String[] getExtensionDescription()
getExtensionDescription
in interface UnboundIDExtension
null
or an empty array if no description should be available.public java.util.Map<java.util.List<java.lang.String>,java.lang.String> getExamplesArgumentSets()
getExamplesArgumentSets
in interface ExampleUsageProvider
null
or empty if there should
not be any example argument sets.public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.util.args.ArgumentException
defineConfigArguments
in interface Configurable
parser
- The argument parser to be updated with the configuration
arguments which may be used by this extension.com.unboundid.util.args.ArgumentException
- If a problem is encountered while updating the
provided argument parser.public void initializeAuthenticator(BrokerContext serverContext, IdentityAuthenticatorConfig config, com.unboundid.util.args.ArgumentParser parser) throws java.lang.Exception
BrokerContext
in a class member so that it can be used elsewhere
in the implementation.
The default implementation is empty.
serverContext
- A handle to the server context for the server in
which this extension is running. Extensions should
typically store this in a class member.config
- The general configuration for this object.parser
- The argument parser which has been initialized from
the configuration for this Identity Authenticator.java.lang.Exception
- If a problem occurs while initializing this store
adapter.public void finalizeAuthenticator()
The default implementation is empty.
public abstract StatusResult getStatus(StatusRequest request)
The content of the response parameters is entirely up to the Identity Authenticator implementation, and should be documented by the implementation.
request
- The status request details.public abstract AuthenticationResult authenticate(AuthenticationRequest request)
If the authentication flow requires further steps, then the result should contain response parameters that can be used to complete the flow. The result must also contain flow state parameters, which will be preserved and resubmitted in the request for the next step. The server encrypts the content of the returned flow state parameters in order to protect any sensitive information.
When the authentication flow is completed successfully, the result must contain the name of the authenticated principal. If authentication fails (e.g. invalid credentials), an unsuccessful result must be returned, rather than an exception.
An authenticator should only return success if the client provided the correct credentials. If additional info is needed or if the provided credentials are incorrect, it should return false. The authenticator should set the principal in the result if it can identify a user with the provided credentials. Otherwise, it should return the principal that was passed in.
The content of the request parameters and response parameters is entirely up to the Identity Authenticator implementation, and should be documented by the implementation.
request
- The authentication request details.