|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet com.caplin.keymaster.servlet.StandardKeyMaster
public class StandardKeyMaster
This class is used as a basic servlet to show how KeyMaster is used to authenticate a user and return an appropriate response. This servlet should only be called after a set of keys have been generated. The servlet accesses the private key file and uses this to authenticate the user. This file is specified in the web.xml configuration file.
The servlet uses reflection to load in the different types of ResponseFormatter. Each type of formatter is specified in the web.xml.
The standard URL parameters are as follows. However it should be noted that some ResponseFormatter implementation classes may require additional parameters.
Parameter | Required | Default | Description |
---|---|---|---|
username | Yes | None | The name of the user that is requesting a KeyMaster token. |
password | No | None | The password, if any, that the user is using to request the KeyMaster token. |
type | No | streamlink | Client type, used to load the appropriate ResponseFormatter. Either “streamlink”, “javascript” or a custom value. |
appid | No | Unknown | An application id that identifies the application requesting a KeyMaster token. |
sourceid | No | None | An identifier indicating the source of data for which the token is required. |
Field Summary | |
---|---|
static String |
CONFIG_LOGGER_FILE
The underlying file that the logging messages will be written out to. |
static String |
CONFIG_LOGGER_LEVEL
The logging level that is required. |
static String |
DEFAULT_FORMATTER_TYPE
Specify the default type of ResponseFormatter used by the servlet |
static String |
DEFAULT_LOG_FILE
Specify the default log file used by the servlet to keep track of all log messages. |
static String |
DEFAULT_LOG_LEVEL
Specify the default level of logging provided by the servlet in the event that a Level is not specified or an invalid one
is specified. |
static String |
EXTRA_DATA_PROVIDER
Specify this attribute in the servlet configuration file to load a custom class which will add extra data to the signed token passed to Liberator. |
static String |
FORMATTER_TYPE_PREFIX
The pattern used at initialisation to identify all the valid types of ResponseFormatter that the servlet can deal with. |
static String |
PROPS_ENABLE_VALUE
Allow the HTTP remote user credentials to be used. |
static String |
PROPS_ENCODE_EXTRA_DATA
Allows the user to add optional data to the token being created. |
static String |
PROPS_HARDWARE_KEYSTORE_KEY_PASSPHRASE
Optional property that specifies the passphrase to use when retrieving the key from a hardware storage solution. |
static String |
PROPS_HARDWARE_KEYSTORE_KEYFILE
Optional property that specifies the location of a key file used to load the KeyStore when using a hardware storage solution. |
static String |
PROPS_HARDWARE_KEYSTORE_PASSPHRASE
Optional property that specifies the passphrase to use when loading the KeyStore when using a hardware storage solution. |
static String |
PROPS_HARDWARE_KEYSTORE_PROVIDER
Optional property that specifies the name of the KeyStore provider to retrieve keys from when using a hardware key storage solution. |
static String |
PROPS_HARDWARE_KEYSTORE_TYPE
Optional property that specifies the type of KeyStore to retrieve keys from when using a hardware key storage solution. |
static String |
PROPS_HTTP_USER
Determines if the username should be the username provided by one of the Caplin products or whether it should use the standard HTTP remote user that will be generated when the user logs in via a single sign on system. |
static String |
PROPS_KEY_PRFILE
The file name and location of the private key created by KeyGenerator . |
static String |
PROPS_KEYSTORE_TYPE
A switch that can be set to "standard" or "hardware" to indicate if KeyMaster should use a standard KeyStore file or a hardware key storage solution. |
static String |
PROPS_SECURITY_CLASS
The class name of the security provider used by this class. |
static String |
PROPS_SECURITY_NAME
A name to identify the security provider by. |
static String |
PROPS_SERVER_NAME
The identifier passed to KeyGenerator used when creating
the set of keys. |
static String |
PROPS_SIGNATURE_ALGORITHM
Optional property that specifies which algorithm to use when generating tokens. |
static String |
PROPS_VALUE_TO_ENABLE_ENCODE_EXTRA_DATA
Allow the addition of extra information onto the token being sent to Liberator. |
static String |
USER_PROVIDER_CLASS_CONFIG
Specify this attribute in the servlet configuration file to load a custom user credentials class. |
Constructor Summary | |
---|---|
StandardKeyMaster()
|
Method Summary | |
---|---|
void |
destroy()
Used to close the logger instance as the servlet is no longer going to be used. |
void |
init()
Initialisation method to set up the servlet and prepare for HTTP Get and Post calls. |
void |
init(javax.servlet.ServletConfig config)
Initialisation method to set up the servlet and prepare for HTTP Get and Post calls. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONFIG_LOGGER_LEVEL
Level
for valid levels.
public static final String CONFIG_LOGGER_FILE
public static final String PROPS_SERVER_NAME
KeyGenerator
used when creating
the set of keys.
public static final String PROPS_KEY_PRFILE
KeyGenerator
. Note: if the key
is to be retrieved from a hardware storage solution then this property
must be omitted.
public static final String PROPS_SECURITY_CLASS
public static final String PROPS_HTTP_USER
public static final String PROPS_ENABLE_VALUE
public static final String PROPS_ENCODE_EXTRA_DATA
public static final String PROPS_VALUE_TO_ENABLE_ENCODE_EXTRA_DATA
public static final String PROPS_KEYSTORE_TYPE
public static final String PROPS_SECURITY_NAME
KeyGenerator
configuration
file.
public static final String PROPS_SIGNATURE_ALGORITHM
public static final String PROPS_HARDWARE_KEYSTORE_TYPE
public static final String PROPS_HARDWARE_KEYSTORE_PROVIDER
public static final String PROPS_HARDWARE_KEYSTORE_KEYFILE
public static final String PROPS_HARDWARE_KEYSTORE_PASSPHRASE
public static final String PROPS_HARDWARE_KEYSTORE_KEY_PASSPHRASE
public static final String USER_PROVIDER_CLASS_CONFIG
UserCredentialsProvider
public static final String FORMATTER_TYPE_PREFIX
ResponseFormatter
that the servlet can deal with.
public static final String DEFAULT_FORMATTER_TYPE
ResponseFormatter
used by the servlet
public static final String DEFAULT_LOG_LEVEL
Level
is not specified or an invalid one
is specified.
public static final String DEFAULT_LOG_FILE
public static final String EXTRA_DATA_PROVIDER
ExtraDataProvider
interface.
Constructor Detail |
---|
public StandardKeyMaster()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
Initialisation method to set up the servlet and prepare for HTTP Get and
Post calls. The method calls init(ServletConfig)
passing it null
which will cause GenericServlet.init()
to be
called.
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
Initialisation method to set up the servlet and prepare for HTTP Get and Post calls. The method sets up the logger to track progress and errors. It configures itself from a standard configuration file (web.xml) or if config is not null then it will use this to configure itself.
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
config
- servlet configuration to use instead of being configured via
web.xml.
javax.servlet.ServletException
public void destroy()
Used to close the logger instance as the servlet is no longer going to be used.
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |