+

Search Tips   |   Advanced Search

(WAS v8.5.0.1)

Create custom security tokens for Web services security using the GenericSecurityTokenFactory SPIs

Use the GenericSecurityTokenFactory SPIs to create custom security tokens for use by the WS-Security runtime. These security tokens can be used for, but are not be limited to, WSSAPIs, JAAS login modules, and custom security tokens.

The GenericSecurityTokenFactory provides several SPIs to create custom tokens that can be emitted with the GenericIssuedTokenGenerateLoginModule or as a custom security token.

A custom security token created with the GenericSecurityTokenFactory is the complete form of a security token that can be emitted by the WS-Security run time. You do not have to write an emitter or receiver, such as writeExternal or readExternal, for the token we create using these SPIs. Only two pieces of information are required:

In the following steps, the custom token being created is a UsernameToken. We selected this token as the custom token to create because it is a well-known form, and has a good mix of elements, sub-elements, and attributes. To determine the methods use to build our own custom tokens, look at the XML for a UsernameToken, and match up that XML with what is being done in the methods included in one of the following steps.


Related tasks

  • Generating a dynamic UsernameToken using a stacked JAAS login module
  • Generating and Consuming custom tokens with the Generic Issue Login Modules