com.ibm.wsspi.wssecurity.token

Class UsernameTokenGenerator

  1. java.lang.Object
  2. extended bycom.ibm.wsspi.wssecurity.token.UsernameTokenGenerator
All implemented interfaces:
com.ibm.ws.webservices.wssecurity.WSSComponent, com.ibm.ws.webservices.wssecurity.WSSGeneratorComponent, Initializable, TokenGeneratorComponent

  1. public class UsernameTokenGenerator
  2. extends java.lang.Object
  3. implements TokenGeneratorComponent
Generates a username token element into the SOAP message according to a given configuration. It also creates the UsernameToken object and stores in in the Subject of the current thread.

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
CHECK_CACHE_UNT
Fields inherited from interface com.ibm.wsspi.wssecurity.token.TokenGeneratorComponent
STANDALONE

Constructor Summary

Constructor and Description
UsernameTokenGenerator()

Method Summary

Modifier and Type Method and Description
  1. void
init(java.util.Map map)
Initializes this generator with a TokenGeneratorConfig object which is passed in by the map parameter.
  1. void
invoke(org.w3c.dom.Document doc,org.w3c.dom.Element parent,java.util.Map context)
Generates a new username token in a SOAP message and sets the token in the Subject of the current thread.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CHECK_CACHE_UNT

  1. public static final java.lang.String CHECK_CACHE_UNT
See Also:

Constructor Detail

UsernameTokenGenerator

  1. public UsernameTokenGenerator()

Method Detail

init

  1. public void init(java.util.Map map)
  2. throws SoapSecurityException
Initializes this generator with a TokenGeneratorConfig object which is passed in by the map parameter.
Specified by:
init in interface com.ibm.ws.webservices.wssecurity.WSSComponent
Specified by:
init in interface Initializable
Parameters:
map - A Map object which contains name-value pairs. These pairs includes a configuration object and <Property> elements in the configuration XMI files. In the map, the TokenGeneratorConfig object is stored with a key of TokenGeneratorConfig.CONFIG_KEY.
Throws:
SoapSecurityException - When there is a problem initializing the generator
See Also:

invoke

  1. public void invoke(org.w3c.dom.Document doc,
  2. org.w3c.dom.Element parent,
  3. java.util.Map context)
  4. throws SoapSecurityException
Generates a new username token in a SOAP message and sets the token in the Subject of the current thread.

Note that token generator processes only single token at a time, i.e., those which matched the Token's Id and (possibly) its reference name given by its "parent" component (that invokes this token generator component), that are propagated throgh the local context. The generated token is added under the parent.

Specified by:
invoke in interface com.ibm.ws.webservices.wssecurity.WSSGeneratorComponent
Parameters:
doc - The Document object that includes a SOAP envelope
parent - The parent element that has the element to be generated
context - A Map object which contains necessary name-value pairs, such as a Subject object.
Throws:
SoapSecurityException - When there is a problem during generating a new username token
See Also:
WSSGeneratorComponent.invoke(org.w3c.dom.Document, org.w3c.dom.Element, java.util.Map)