com.ibm.wsspi.security.token

Class WSOpaqueTokenHelper

  1. java.lang.Object
  2. extended bycom.ibm.wsspi.security.token.WSOpaqueTokenHelper

  1. public class WSOpaqueTokenHelper
  2. extends java.lang.Object
This class provides methods that serialize the Subject contents on the sending end of a protocol and deserializes them on the target end. It's recommended that these methods be called from a JAAS login module on both ends to preserve the custom pluggable behavior already established.
Since:
5.1.1
Version:
5.1.1

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
customPrincipalTokensHeader
  1. static
  2. java.lang.String
customPrincipalTokensHeaderEnding
  1. static
  2. java.lang.String
customPrivateTokensHeader
  1. static
  2. java.lang.String
customPrivateTokensHeaderEnding
  1. static
  2. java.lang.String
customPublicTokensHeader
  1. static
  2. java.lang.String
customPublicTokensHeaderEnding
  1. static
  2. java.lang.String
customTokensHeader
  1. static
  2. java.lang.String
tokenHeader
  1. static
  2. java.lang.String
wsCredHashHeader
  1. static
  2. java.lang.String
wsTokensHeader

Method Summary

Modifier and Type Method and Description
  1. byte[]
createOpaqueTokenFromSubject(javax.security.auth.Subject subject)
This method is called from the RMI Outbound LoginModule to get the opaque token used for the CSIv2 authorization token.
  1. byte[]
createOpaqueTokenFromTokenHolderList(javax.security.auth.Subject subject,java.util.ArrayList tokenHolders)
This method is called from the WSOpaqueTokenHelper.createOpaqueTokenFromSubject() to create the byte[] from the ArrayList of token types.
  1. java.util.ArrayList
createTokenHolderListFromOpaqueToken(byte[] opaque_token)
This method is called by the RMI protocol to get the ArrayList of TokenHolder objects which are passed into the login via the WSTokenHolderCallback.
  1. static
  2. java.lang.Object
deserialize(byte[] buf)
Deserialize an object
  1. static
  2. WSOpaqueTokenHelper
getInstance()
  1. java.lang.String
getOpaqueTokenLookup()
  1. java.lang.String
getOpaqueTokenName()
  1. int
getOpaqueTokenVersion()
  1. static
  2. byte[]
serialize(java.lang.Object src)
Serialize an object
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

tokenHeader

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

wsCredHashHeader

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

wsTokensHeader

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

customTokensHeader

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

customPublicTokensHeader

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

customPublicTokensHeaderEnding

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

customPrivateTokensHeader

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

customPrivateTokensHeaderEnding

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

customPrincipalTokensHeader

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

customPrincipalTokensHeaderEnding

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

Method Detail

getInstance

  1. public static WSOpaqueTokenHelper getInstance( )

getOpaqueTokenName

  1. public java.lang.String getOpaqueTokenName( )

getOpaqueTokenLookup

  1. public java.lang.String getOpaqueTokenLookup( )

getOpaqueTokenVersion

  1. public int getOpaqueTokenVersion( )

createOpaqueTokenFromSubject

  1. public byte[] createOpaqueTokenFromSubject( javax.security.auth.Subject subject)
  2. throws com.ibm.websphere.security.auth.WSLoginFailedException

This method is called from the RMI Outbound LoginModule to get the opaque token used for the CSIv2 authorization token. It combines the authorization token(s) + propagation token(s) + WSCredential hash table + custom objects to create an opaque token that can be regenerated at the target.

The following is the format of the opaque token (version 1) which is identified using the OMG VMCID 0x494210CF. Any other token flowing in the CSIv2 authorization token layer will have a different VMCID and thus a different format. It's possible for different versions of this token (WSOPAQUE) to be carried using the same VMCID. The token version can be identified during deserialization and the appropriate method for deserializing can be chosen at that time.

Token Header = "WSOPAQUE" Token Version (byte) = 1 (optional) { WSCred Hashtable Header = "WSCREDHASH" Hashtable length (integer) = length Hashtable bytes } WebSphere Token(s) Header = "WSTOKEN" Number of tokens present (byte) = # of tokens (sequence of) [ Token name length (byte) = length Token name bytes = token name (typically the class name) Token version (byte) = version Token bytes length (byte) = length Token bytes = token ] (optional) { Custom Token(s) Header = "CUSTOM" Number of custom tokens present (byte) = # of tokens (sequence of) [ Token name length (byte) = length Token name bytes = token name (either "CUSTOM_PUBLIC", "CUSTOM_PRIVATE" or "CUSTOM_PRINCIPAL") Token version (byte) = version Token bytes length (byte) = length Token bytes = token ] }

Throws:
com.ibm.websphere.security.auth.WSLoginFailedException

createOpaqueTokenFromTokenHolderList

  1. public byte[] createOpaqueTokenFromTokenHolderList( javax.security.auth.Subject subject,
  2. java.util.ArrayList tokenHolders)
  3. throws java.lang.Exception

This method is called from the WSOpaqueTokenHelper.createOpaqueTokenFromSubject() to create the byte[] from the ArrayList of token types.

Throws:
java.lang.Exception

createTokenHolderListFromOpaqueToken

  1. public java.util.ArrayList createTokenHolderListFromOpaqueToken( byte[] opaque_token)
  2. throws com.ibm.websphere.security.WSSecurityException

This method is called by the RMI protocol to get the ArrayList of TokenHolder objects which are passed into the login via the WSTokenHolderCallback. The RMI Inbound login modules handle deserializing the majority of the TokenHolders in this list. Custom login modules need to only be concerned with deserializing the custom AuthorizationToken or PropagationToken implementations which may have custom encryption (why we cannot deserialize it).

Throws:
com.ibm.websphere.security.WSSecurityException

serialize

  1. public static byte[] serialize( java.lang.Object src)
  2. throws java.lang.Exception
Serialize an object
Throws:
java.lang.Exception

deserialize

  1. public static java.lang.Object deserialize( byte[] buf)
  2. throws java.lang.Exception
Deserialize an object
Throws:
java.lang.Exception