|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.pingidentity.opentoken.AgentConfiguration
public class AgentConfiguration
Represents the configuration state of an Agent instance. Provides methods for configuration file I/O.
Field Summary | |
---|---|
static String |
AGENT_CONFIG_FILE_DEFALUT
Default location on disk for the configuration file |
static String |
COOKIE_DOMAIN_DEFAULT
Default domain to use when writing a token as a cookie |
static String |
COOKIE_PATH_DEFAULT
Default path to use when writing a token as a cookie |
static boolean |
DETECT_MALFORMED_ATTRIBUTES_DEFAULT
Default flag to enable/disable Detect Malformed Attributes |
static String |
ISO8601_FORMAT
Date/time format to use for not-before, not-on-or-after, and renew-until |
static int |
NOT_BEFORE_TOLERANCE_DEFAULT
Default number of seconds in the future that validation of the not-before field will permit |
static boolean |
OBFUSCATE_PASSWORD_DEFAULT
Default flag indicating if the password should be obfuscated |
static boolean |
REMOVE_TRAILING_BACKSLASH_DEFAULT
Default flag to enable/disable Trailing Backslash Removal |
static int |
RENEW_UNTIL_LIFETIME_DEFALUT
Sets the span of time (in seconds) during which this token may be renewed |
static boolean |
SECURE_COOKIE_DEFAULT
Default flag indicating if cookie will be sent only via secure transport (HTTPS) |
static boolean |
SESSION_COOKIE_DEFAULT
Default flag indicating if cookie will expire at the end of the browser session or in getTokenLifetime() seconds |
static int |
TOKEN_LIFETIME_DEFAULT
Default number of seconds that token will be valid |
static String |
TOKEN_NAME_DEFAULT
Default name to use to identify the token (either as a query parameter or cookie) |
static boolean |
USE_COOKIE_DEFAULT
Default flag indicating if the token will be exchanged using a cookie |
static boolean |
USE_SUN_JCE_DEFAULT
Default flag indicating if the SunJCE provider should be used for Token encryption |
static boolean |
USE_VERBOSE_TOKEN_EXCEPTION_MESSAGES_DEFAULT
Default flag indicating if verbose error messages should be used in TokenException |
static TimeZone |
UTC_TZ
Timezone to use for not-before, not-on-or-after, and renew-until |
Constructor Summary | |
---|---|
AgentConfiguration()
Constructs an AgentConfiguration instance using configuration file on CLASSPATH. |
|
AgentConfiguration(boolean loadDefaultConfigurationFile)
Constructs an AgentConfiguration instance using configuration file on CLASSPATH. |
|
AgentConfiguration(InputStream configStream)
Constructs an AgentConfiguration instance using configuration from the provided InputStream. |
|
AgentConfiguration(String file)
Constructs an AgentConfiguration instance using configuration file on CLASSPATH. |
Method Summary | |
---|---|
AgentConfiguration |
copy()
Creates a copy of the current AgentConfiguration instance. |
int |
getCipherSuite()
Returns the number representing which cipher suite to be used for token encryption. |
String |
getCookieDomain()
Returns the domain used when writing a token as a cookie. |
String |
getCookiePath()
Returns the path used when writing a token as a cookie. |
int |
getNotBeforeTolerance()
Returns the number of seconds in the future that validation of the not-before field will permit. |
String |
getPassword()
Gets the password to use for token encryption; actual key is generated via PBKDF2. |
int |
getRenewUntilLifetime()
Sets the span of time (in seconds) during which this token may be renewed. |
int |
getTokenLifetime()
Returns the span of time (in seconds) during which generated tokens will be considered valid. |
String |
getTokenName()
Returns the name used to identify the token (either as a query parameter or cookie). |
boolean |
isDetectMalformedAttributes()
Indicates whether Detect Malformed Attributes or not. |
boolean |
isObfuscatePassword()
Returns a flag indicating if the password should be obfuscated. |
boolean |
isRemoveTrailingBackslash()
Indicates whether remove trailing backslash in attributes or not |
boolean |
isSecureCookie()
Returns a flag indicating if cookie will only be sent via secure transport (HTTPS). |
boolean |
isSessionCookie()
Returns a flag indicating if cookie will expire at the end of the browser session or in getTokenLifetime() seconds. |
boolean |
isUseCookie()
Returns a flag indicating if the token will be exchanged using a cookie. |
boolean |
isUseSunJCE()
Returns a flag indicating if the SunJCE provider should be used for token encryption, otherwise, use JVM default. |
boolean |
isUseVerboseErrorMessages()
Indicates whether TokenException is to contain a verbose error message rather than generic. |
void |
loadConfiguration(InputStream is)
Reads agent configuration from an InputStream that was previously generated by storeConfiguration or PingFederate. |
void |
setCipherSuite(int cipherSuite)
Sets the number representing which cipher suite to be used for token encryption. |
void |
setCookieDomain(String cookieDomain)
Sets the domain to be used when writing a token as a cookie. |
void |
setCookiePath(String cookiePath)
Sets the path to be used when writing a token as a cookie. |
void |
setDetectMalformedAttributes(boolean detectMalformedAttributes)
Sets the Detect Malformed Attribute value. |
void |
setNotBeforeTolerance(int notBeforeTolerance)
Sets the number of seconds in the future that validation of the not-before field will permit. |
void |
setObfuscatePassword(boolean obfuscatePassword)
Sets a flag indicating if the password should be obfuscated. |
void |
setObfuscatePasword(boolean obfuscatePassword)
Deprecated. |
void |
setPassword(String password)
Sets the unobfuscated (clear) password that will be used. |
void |
setRemoveTrailingBackslash(boolean removeTrailingBackslash)
Sets the Remove Trailing Backslash value. |
void |
setRenewUntilLifetime(int renewUntilLifetime)
Returns the span of time during which generated tokens will be acceptable for renewal. |
void |
setSecureCookie(boolean secureCookie)
Returns a flag indicating if cookie will only be sent via secure transport (HTTPS). |
void |
setSessionCookie(boolean sessionCookie)
Sets a flag indicating if cookie will expire at the end of the browser session or in getTokenLifetime() seconds. |
void |
setTokenLifetime(int tokenLifetime)
Sets the span of time during which generated tokens will be considered valid. |
void |
setTokenName(String tokenName)
Sets the name to be used to identify the token (either as a query parameter or cookie). |
void |
setUseCookie(boolean useCookie)
Sets a flag indicating if the token will be exchanged using a cookie (or, alternatively, a query parameter) |
void |
setUseSunJCE(boolean useSunJCE)
Sets a flag indicating if the SunJCE provider should be used for Token encryption. |
void |
setUseVerboseErrorMessages(boolean useVerboseErrorMessages)
Sets the indicator for verbose error messages in TokenException. |
void |
storeConfiguration(OutputStream os)
Writes agent configuration to an OutputStream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean USE_VERBOSE_TOKEN_EXCEPTION_MESSAGES_DEFAULT
public static final boolean DETECT_MALFORMED_ATTRIBUTES_DEFAULT
public static final boolean REMOVE_TRAILING_BACKSLASH_DEFAULT
public static final int TOKEN_LIFETIME_DEFAULT
public static final int RENEW_UNTIL_LIFETIME_DEFALUT
public static final int NOT_BEFORE_TOLERANCE_DEFAULT
public static final boolean USE_SUN_JCE_DEFAULT
public static final boolean OBFUSCATE_PASSWORD_DEFAULT
public static final boolean SESSION_COOKIE_DEFAULT
getTokenLifetime()
seconds
public static final boolean SECURE_COOKIE_DEFAULT
public static final boolean USE_COOKIE_DEFAULT
public static final String COOKIE_PATH_DEFAULT
public static final String COOKIE_DOMAIN_DEFAULT
public static final String TOKEN_NAME_DEFAULT
public static final String AGENT_CONFIG_FILE_DEFALUT
public static final String ISO8601_FORMAT
public static final TimeZone UTC_TZ
Constructor Detail |
---|
public AgentConfiguration(InputStream configStream) throws IOException
configStream
- an InputStream containing agent configuration.
IOException
- when the configuration is invalid or the configStream generates an errorpublic AgentConfiguration()
AGENT_CONFIG_FILE_DEFALUT
. If the file is not found,
an Agent will be constructed using default values.
public AgentConfiguration(boolean loadDefaultConfigurationFile)
AGENT_CONFIG_FILE_DEFALUT
if loadDefaultConfigurationFile is true.
loadDefaultConfigurationFile
- flag indicating if default configuration file should be loadedpublic AgentConfiguration(String file) throws IOException
file
- filename on CLASSPATH or fully qualified path to the file on disk
IOException
Method Detail |
---|
public boolean isUseVerboseErrorMessages()
USE_VERBOSE_TOKEN_EXCEPTION_MESSAGES_DEFAULT
public void setUseVerboseErrorMessages(boolean useVerboseErrorMessages)
USE_VERBOSE_TOKEN_EXCEPTION_MESSAGES_DEFAULT
public boolean isRemoveTrailingBackslash()
REMOVE_TRAILING_BACKSLASH_DEFAULT
public void setRemoveTrailingBackslash(boolean removeTrailingBackslash)
REMOVE_TRAILING_BACKSLASH_DEFAULT
public boolean isDetectMalformedAttributes()
DETECT_MALFORMED_ATTRIBUTES_DEFAULT
public void setDetectMalformedAttributes(boolean detectMalformedAttributes)
DETECT_MALFORMED_ATTRIBUTES_DEFAULT
public int getTokenLifetime()
TOKEN_LIFETIME_DEFAULT
public void setTokenLifetime(int tokenLifetime)
tokenLifetime
- the timespan (in seconds)TOKEN_LIFETIME_DEFAULT
public int getRenewUntilLifetime()
RENEW_UNTIL_LIFETIME_DEFALUT
public void setRenewUntilLifetime(int renewUntilLifetime)
renewUntilLifetime
- the timespan (in seconds)RENEW_UNTIL_LIFETIME_DEFALUT
public int getNotBeforeTolerance()
NOT_BEFORE_TOLERANCE_DEFAULT
public void setNotBeforeTolerance(int notBeforeTolerance)
notBeforeTolerance
- number of secondsNOT_BEFORE_TOLERANCE_DEFAULT
public int getCipherSuite()
Token.CIPHER_SUITE_3DES168CBC
,
Token.CIPHER_SUITE_AES128CBC
,
Token.CIPHER_SUITE_AES256CBC
,
Token.CIPHER_SUITE_NULL
public void setCipherSuite(int cipherSuite)
cipherSuite
- the suite numberToken.CIPHER_SUITE_3DES168CBC
,
Token.CIPHER_SUITE_AES128CBC
,
Token.CIPHER_SUITE_AES256CBC
,
Token.CIPHER_SUITE_NULL
public boolean isUseSunJCE()
USE_SUN_JCE_DEFAULT
public void setUseSunJCE(boolean useSunJCE)
useSunJCE
- if true, SunJCE is used; if false, the JVM default is usedpublic boolean isObfuscatePassword()
OBFUSCATE_PASSWORD_DEFAULT
public void setObfuscatePasword(boolean obfuscatePassword)
obfuscatePassword
- if true, password is obfuscatedpublic void setObfuscatePassword(boolean obfuscatePassword)
obfuscatePassword
- if true, password is obfuscatedpublic boolean isSessionCookie()
getTokenLifetime()
seconds.
SESSION_COOKIE_DEFAULT
public void setSessionCookie(boolean sessionCookie)
getTokenLifetime()
seconds.
sessionCookie
- true if cookie should expire at the end of the browser session; false if Cookie should expire in #getTokenLifeTime()
secondspublic boolean isSecureCookie()
SECURE_COOKIE_DEFAULT
public void setSecureCookie(boolean secureCookie)
secureCookie
- true if cookie will be sent only via secure transport (HTTPS); false if permissable to send cookie via unsecure transport (HTTP)public boolean isUseCookie()
USE_COOKIE_DEFAULT
public void setUseCookie(boolean useCookie)
useCookie
- true if token will be exchanged as a cookie; false if the token will be exchanged as a query parameterpublic String getCookiePath()
COOKIE_PATH_DEFAULT
public void setCookiePath(String cookiePath)
cookiePath
- the pathpublic String getCookieDomain()
COOKIE_DOMAIN_DEFAULT
public void setCookieDomain(String cookieDomain)
cookieDomain
- the domainpublic String getPassword()
public void setPassword(String password)
password
- the unobfuscated passwordpublic String getTokenName()
TOKEN_NAME_DEFAULT
public void setTokenName(String tokenName)
tokenName
- the token namepublic void storeConfiguration(OutputStream os) throws IOException
os
- destination of configuration data
IOException
public void loadConfiguration(InputStream is) throws IOException
is
- source of configuration data
IOException
public AgentConfiguration copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |