When you develop Session Initiation Protocol (SIP) applications, you can create a custom trust association interceptor (TAI).
You may want to familiarize yourself with the general TAI information contained in the Trust Associations documentation. Developing a SIP TAI is similar to developing any other custom interceptors used in trust associations. In fact, a custom TAI for a SIP application is actually an extension of the trust association interceptor model. Refer to the Developing a custom interceptor for trust associations section for more details.
TAI can be invoked by a SIP servlet request or a SIP servlet response. To implement a custom SIP TAI, you need to write your own Java class.
Argument or action | For a SIP request | For a SIP response |
---|---|---|
Value of req argument | The incoming request | Null |
Value of resp argument | Null | The incoming response |
Action for valid response credentials | Return TAIResult.status containing SC_OK and a user ID or unique ID | Return TAIResult.status containing SC_OK and a user ID or unique ID |
Action for incorrect response credentials | Return the TAIResult with the 4xx status | Return the TAIResult with the 4xx status |
The sequence of events is as follows:
Your TAI implementation can modify a SIP message, but the modified message will not be usable within the request mapping process, because it finishes before the container invokes the TAI.
The com.ibm.wsspi.security.tai.TAIResult class, defined in the WASProductDir/plugins/com.ibm.ws.runtime_1.0.0.jar file, has three static methods for creating a TAIResult. The TAIResult create methods take an int type as the first parameter. WebSphere Application Server expects the result to be a valid HTTP request return code and is interpreted as follows:
If the value is HttpServletResponse.SC_OK, this response tells WebSphere Application Server that the TAI has completed its negotiation. The response also tells WebSphere Application Server use the information in the TAIResult to create a user identity.
The created TAIResults have the meanings shown in Meanings of TAIResults.
TAIResult | Explanation |
---|---|
public static TAIResult create(int status); | Indicates a status to WebSphere Application Server. The status should not be SC_OK because the identity information is provided. |
public static TAIResult create(int status, String principal); | Indicates a status to WebSphere Application Server and provides the user ID or the unique ID for this user. WebSphere Application Server creates credentials by querying the user registry. |
public static TAIResult create(int status, String principal, Subject subject); | Indicates a status to WebSphere Application Server, the user ID or the unique ID for the user, and a custom Subject. If the Subject contains a Hashtable, the principal is ignored. The contents of the Subject becomes part of the eventual user Subject. |