com.ibm.wsspi.wssecurity.auth.token

Class LTPAToken

  1. java.lang.Object
  2. extended bycom.ibm.wsspi.wssecurity.auth.token.WSSToken
  3. extended bycom.ibm.wsspi.wssecurity.auth.token.LTPAToken
All implemented interfaces:
PropagationToken, Token, java.lang.Cloneable
Direct known subclasses:
LTPATokenWrapper

  1. public class LTPAToken
  2. extends WSSToken
This class is a token object implementation for LTPA tokens. It extends the WSSToken class, which implements the Token class. It will typically be created by the LTPATokenGenerator and process by the LTPATokenConsumer. Protected by following Java 2 Security permissions: com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.LTPAToken.setBytes") com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.LTPAToken.getBytes")
See Also:
WSSToken, Token

Nested Class Summary

Nested classes/interfaces inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
WSSToken.AttributesEnumerator

Field Summary

Fields inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
_attributes, _callerChecked, _error, _keyInfoType, _processed, _referenced, _tokenelem, _tokenId, _trusted, _usedTokenConsumer, _usedTokenGenerator, _usedToLogin, _version, _vtype

Constructor Summary

Constructor and Description
LTPAToken(java.lang.String tokenId,byte[] cred)
Constructor
LTPAToken(java.lang.String tokenId,byte[] cred,java.lang.String username,char[] password,org.w3c.dom.Element elem)
Constructor

Method Summary

Modifier and Type Method and Description
  1. boolean
equals(java.lang.Object o)
  1. byte[]
getBytes()
Returns the credential binary data of the LTPA token.
  1. long
getExpiration()
Returns the expiration of the credential.
  1. java.lang.String
getPrincipal()
Returns the username if set, otherwise null.
  1. java.lang.String
getUniqueID()
  1. int
hashCode()
  1. boolean
isValid()
Returns if the token is valid or not.
  1. void
setBytes(byte[] cred)
Sets the credential binary data of the LTPA token.
  1. java.lang.String
toString()
Methods inherited from class com.ibm.wsspi.wssecurity.auth.token.WSSToken
addAttribute, clone, getAttributeNames, getAttributes, getCallerChecked, getElement, getError, getId, getKeyInfoType, getName, getType, getUsedTokenConsumer, getUsedTokenGenerator, getUsedToLogin, getVersion, isForwardable, isProcessed, isReadOnly, isReferenced, isTrusted, setCallerChecked, setElement, setError, setId, setKeyInfoType, setProcessed, setReadOnly, setReferenced, setTrusted, setType, setType, setUsedTokenConsumer, setUsedTokenGenerator, setUsedToLogin
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

LTPAToken

  1. public LTPAToken(java.lang.String tokenId,
  2. byte[] cred,
  3. java.lang.String username,
  4. char[] password,
  5. org.w3c.dom.Element elem)
Constructor
Parameters:
tokenId - The token identifier
cred - A byte[] containing the credential
username - The username string; may be null if there is no username
password - The password as a char[]; may be null if there is no password
elem - A token element; may be null if there is no token element

LTPAToken

  1. public LTPAToken(java.lang.String tokenId,
  2. byte[] cred)
Constructor

Method Detail

setBytes

  1. public void setBytes(byte[] cred)
Sets the credential binary data of the LTPA token.
Parameters:
cred - The credential in the form of a byte[] Protected by com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.LTPAToken.setBytes")

getBytes

  1. public byte[] getBytes()
Returns the credential binary data of the LTPA token.
Specified by:
getBytes in interface Token
Overrides:
getBytes in class WSSToken
Returns:
The credential binary data as a byte[] Protected by com.ibm.websphere.security.WebSphereRuntimePermission("wssecurity.LTPAToken.getBytes")

isValid

  1. public boolean isValid()
Returns if the token is valid or not.
Returns:
True is valid, false otherwise
See Also:

getExpiration

  1. public long getExpiration()
Returns the expiration of the credential.
Returns:
The credential expiration as a long
See Also:

getPrincipal

  1. public java.lang.String getPrincipal( )
Returns the username if set, otherwise null.
Returns:
The username
See Also:

getUniqueID

  1. public java.lang.String getUniqueID( )
Description copied from interface: Token

Returns a unique identifier of the token based upon information that the provider considers to be unique. This will be used for caching purposes and may be used in combination with other token unique IDs that are part of the same Subject to form a Subject unique identifier.

An implementation of this method should be careful to only change the token uniqueness when required. Any login which generates a new unique ID will create a Subject entry in the cache, which will increase memory requirements.

This method should return null if the token does not need to affect the cache uniqueness. Typically, if using only static registry attributes, this should return null. However, if dynamic attributes are used including strength of authentication, time of day, etc. you may affect the cache uniqueness by returning a non-null value that reflects how you want the cache key too look. Typically, the token implementation will know what is most unique about the dynamic data, however, an alternative is to return a UUID. The values of getUniqueID() from all custom tokens present in the Subject will be added together and used in the SSO token for lookup. A one-way hash of this string will be created as the unique ID. When altering a token to contain a non-null value here, the token must be added to the Subject prior to the commit phase or before the wsMap module commit is called.

Returns:
String

hashCode

  1. public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

  1. public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

  1. public java.lang.String toString( )
Overrides:
toString in class java.lang.Object