55 lines
3.9 KiB
HTML
55 lines
3.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
|
|
|
<title>Pluggable token support</title>
|
|
</head>
|
|
|
|
<BODY>
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
<h6><a name="wssecplugtoken"></a>Pluggable token support</h6>
|
|
|
|
<p>You can extend the WebSphere Application Server - Express login mapping mechanism to handle new types of authentication tokens. WebSphere Application Server - Express provides a pluggable framework to generate security tokens on the sender-side of the message and to validate the security token on the receiver-side of the message. The framework is based on the Java Authentication and Authorization Service (JAAS) Application Programming Interfaces (APIs). For more information, see <a href="wssecplugtokgen.htm">Generating a pluggable token</a> and <a href="wssecplugtokval.htm">Validating a pluggable token</a>.</p>
|
|
|
|
<p>Users can use the javax.security.auth.callback.CallbackHandler implementation to create a new type of security token following these guidelines:</p>
|
|
|
|
<ul>
|
|
<li><p>Use a constructor that takes a user name (of type String or <tt>null</tt>, if not defined), password (of type <tt>char[]</tt> or <tt>null</tt>, if not defined) and java.util.Map (empty, if properties are not defined).</p></li>
|
|
|
|
<li><p>Use handle() methods that can process the following implementations:</p>
|
|
<ul>
|
|
<li>javax.security.auth.callback.NameCallback</li>
|
|
<li>javax.security.auth.callback.PasswordCallback</li>
|
|
<li>com.ibm.websphere.security.auth.callback.WSCredTokenCallbackImpl</li>
|
|
<li>com.ibm.wsspi.wssecurity.auth.callback.XMLTokenCallback</li>
|
|
</ul><p></p></li>
|
|
|
|
<li><p>Encode the token byte by using the security handler and not by using the javax.security.auth.callback.CallbackHandler implementation if the following items are true:</p>
|
|
<ul>
|
|
<li>Either the javax.security.auth.callback.NameCallback or the javax.security.auth.callback.PasswordCallback implementation is populated with data, then a <wsse:UsernameToken> element is created.</li>
|
|
<li>com.ibm.websphere.security.auth.callback.WSCredTokenCallbackImpl is populated, the <wsse:BinarySecurityToken> element is created from the com.ibm.websphere.security.auth.callback.WSCredTokenCallbackImpl implementation.</li>
|
|
<li>com.ibm.wsspi.wssecurity.auth.callback.XMLTokenCallback is populated, a XML-based token is created based on the Document Object Model (DOM) element that is returned from the XMLTokenCallback.</li>
|
|
</ul></li>
|
|
</ul>
|
|
|
|
<p>You can implement the com.ibm.wsspi.wssecurity.auth.callback.CallbackHandlerFactory interface, which is a factory for instantiating the javax.security.auth.callback.CallbackHandler. For your own implementation, you must provide the javax.security.auth.callback.CallbackHandler interface. The Web service security run time instantiates the factory implementation class and passes the authentication information from the Web services message header to the factory class through the setter methods. The Web services security run time then invokes the newCallbackHandler() method of the factory implementation class to obtain an instance of the javax.security.auth.CallbackHandler object. The object is passed to the JAAS login configuration.</p>
|
|
|
|
<p>The following example is the definition of the CallbackHandlerFactory interface:</p>
|
|
|
|
<pre>public interface com.ibm.wsspi.wssecurity.auth.callback.CallbackHandlerFactory {
|
|
public void setUsername(String username);
|
|
public void setRealm(String realm);
|
|
public void setPassword(String password);
|
|
public void setHashMap(Map properties);
|
|
public void setTokenByte(byte[] token);
|
|
public void setXMLToken(Element xmlToken);
|
|
public CallbackHandler newCallbackHandler();
|
|
}</pre>
|
|
|
|
</body>
|
|
</html>
|