InfoCenter Home > 5.6.3: Writing a custom interceptorIf you are using a third-part reverse proxy server other than Tivoli WebSeal Version 3.6, you must provide an implementation class for the WebSphere interceptor interface for your proxy server. This file describes the interface you must implement. Using the TrustAssociationInterceptor interfaceWebSphere Application Server provides the interceptor Java interface, com.ibm.websphere.security.TrustAssociationInterceptor, which defines the following methods:
The isTargetInterceptor method is used to determine whether the request originated with the proxy server associated with the interceptor. The implementation code must examine the incoming request object and determine if the proxy server forwarding the request is a valid proxy server for this interceptor. The result of this method determines whether the interceptor processes the request or not. The validateEstablishedTrust method determines if the proxy server from which the request originated is trusted or not. This method is called after the isTargetInterceptor method. The implementation code must authenticate the proxy server. The authentication mechanism is proxy-server-specific. For example, in the WebSphere-provided implementation for the WebSeal server, this method retrieves the basic-authentication information from the HTTP header and validates the information against the user registry used by WebSphere Application Server. If the credentials are invalid, the code throws the WebTrustAssociationException exception, indicating that the proxy server is not trusted and the request is to be denied. The getAuthenticatedUsername method is called after trust has been established between the proxy server and WebSphere Application Server. WebSphere Application Server has accepted the proxy server's authentication of the request and must now authorize the request. To authorize the request, the name of the original requestor must be subjected to an authorization policy to determine if the requestor has the necessary privilege. The implementation code for this method must extract the user name from the HTTP request header and determine if that user is entitled to the requested resource. For example, in the WebSphere-provided implementation for the WebSeal server, the method looks for an iv-user attribute in the HTTP request header and extracts the user ID associated with it for authorization. After the interceptor class has been created, WebSphere Application Server must be configured to use it by setting properties in the trustedservers.properties file. This procedure is described for the WebSeal interceptor in Configuring trust association between WebSphere and WebSeal, and the procedure described there varies as follows:
Making your custom interceptor configurableTo allow configuration of your custom interceptor by reading a configuration file, you can subclass the WebSphere-provided class com.ibm.websphere.security.WebSphereBaseTrustAssociationInterceptor and provide implementations of the following methods:
The init method reads the configuration file specified for the
interceptor. The configuration file is specified in the trustedservers.properties file by using a property, the name of which is determined by this
pattern:
The cleanup method does any necessary termination work for the interceptor. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|