<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.umiacs.umd.edu/adapt/index.php?action=history&amp;feed=atom&amp;title=Saml%3AAuthenticateClient</id>
	<title>Saml:AuthenticateClient - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.umiacs.umd.edu/adapt/index.php?action=history&amp;feed=atom&amp;title=Saml%3AAuthenticateClient"/>
	<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/adapt/index.php?title=Saml:AuthenticateClient&amp;action=history"/>
	<updated>2026-04-05T20:09:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.7</generator>
	<entry>
		<id>https://wiki.umiacs.umd.edu/adapt/index.php?title=Saml:AuthenticateClient&amp;diff=1989&amp;oldid=prev</id>
		<title>Scsong at 23:44, 11 September 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/adapt/index.php?title=Saml:AuthenticateClient&amp;diff=1989&amp;oldid=prev"/>
		<updated>2008-09-11T23:44:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:44, 11 September 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Prime wss4j===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Prime wss4j===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Next, you need to prime &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;nop&amp;gt;&lt;/del&gt;CachedDoAllSender with information regarding the assertion and keystore to use.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Next, you need to prime CachedDoAllSender with information regarding the assertion and keystore to use.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot;&gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;wss4j wants to pull the password to unlock your private key from a callback class. This is the same as retrieving the password for doing ws-security &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;nop&amp;gt;&lt;/del&gt;UsernameToken authentication. A sample callback class follows:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;wss4j wants to pull the password to unlock your private key from a callback class. This is the same as retrieving the password for doing ws-security UsernameToken authentication. A sample callback class follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Scsong</name></author>
	</entry>
	<entry>
		<id>https://wiki.umiacs.umd.edu/adapt/index.php?title=Saml:AuthenticateClient&amp;diff=1988&amp;oldid=prev</id>
		<title>Scsong at 23:43, 11 September 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/adapt/index.php?title=Saml:AuthenticateClient&amp;diff=1988&amp;oldid=prev"/>
		<updated>2008-09-11T23:43:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Connect to SAML Authenticated service==&lt;br /&gt;
&lt;br /&gt;
SAML Authenticated calls are done using wss4j along with some helper classes in the pawn-ws-sec project. These handle signing messages, and embedding assertions in the soap message.&lt;br /&gt;
&lt;br /&gt;
===Configure WSS4j===&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;ll need to create a client deployment descriptor to tell wss4j to handle signing messages and to tell it to use different classes to do the signing. This connects to the Receiver service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;deployment xmlns=&amp;quot;http://xml.apache.org/axis/wsdd/&amp;quot; xmlns:java=&amp;quot;http://xml.apache.org/axis/wsdd/providers/java&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;transport name=&amp;quot;http&amp;quot; pivot=&amp;quot;java:org.apache.axis.transport.http.HTTPSender&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;globalConfiguration &amp;gt;&lt;br /&gt;
  &amp;lt;/globalConfiguration &amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;service name=&amp;quot;Receiver&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;requestFlow&amp;gt;&lt;br /&gt;
            &amp;lt;handler type=&amp;quot;java:edu.umiacs.wssec.CachedDoAllSender&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;parameter name=&amp;quot;action&amp;quot; value=&amp;quot;Timestamp SAMLTokenSigned&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;/handler&amp;gt; &lt;br /&gt;
        &amp;lt;/requestFlow&amp;gt;&lt;br /&gt;
    &amp;lt;/service&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/deployment&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Prime wss4j===&lt;br /&gt;
&lt;br /&gt;
Next, you need to prime &amp;lt;nop&amp;gt;CachedDoAllSender with information regarding the assertion and keystore to use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    CachedDoAllSender.setSignatureKeyStore(keystore);&lt;br /&gt;
    CachedDoAllSender.setSamlAssertion(samlAssertion);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create call===&lt;br /&gt;
&lt;br /&gt;
Now when you want to call a saml authenticated service, you must first create a service locator and call based on the deployment descriptor above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        ReceiverServiceLocator recvSl;&lt;br /&gt;
        Receiver               recv;&lt;br /&gt;
&lt;br /&gt;
        String                 url = &amp;quot;http://localhost:8080/pawn-archive/services/Receiver&amp;quot;&lt;br /&gt;
        EngineConfiguration    config = new FileProvider(&amp;quot;client.deploy.wsdd&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
        recvSl = new ReceiverServiceLocator(config);&lt;br /&gt;
        recvSl.setReceiverEndpointAddress(url);&lt;br /&gt;
        recv = schedSl.getReceiver();&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next step is to configure the call &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        Stub stub = (stub)recv;&lt;br /&gt;
&lt;br /&gt;
        stub._setProperty(WSHandlerConstants.SIG_KEY_ID, &amp;quot;DirectReference&amp;quot;);&lt;br /&gt;
        stub._setProperty(WSHandlerConstants.USER, KEYSTORE_ALIAS); // alias w/ priv/pub keypair&lt;br /&gt;
        stub._setProperty(WSHandlerConstants.PW_CALLBACK_REF, new PasswordCallBack(KEYSTORE_PASS));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wss4j wants to pull the password to unlock your private key from a callback class. This is the same as retrieving the password for doing ws-security &amp;lt;nop&amp;gt;UsernameToken authentication. A sample callback class follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class PasswordCallBack implements CallbackHandler {&lt;br /&gt;
&lt;br /&gt;
    private String pass;&lt;br /&gt;
&lt;br /&gt;
    public PasswordCallBack(String pass) {&lt;br /&gt;
        this.pass = pass;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void handle(javax.security.auth.callback.Callback[] callbacks) &lt;br /&gt;
            throws java.io.IOException, &lt;br /&gt;
            javax.security.auth.callback.UnsupportedCallbackException {&lt;br /&gt;
        &lt;br /&gt;
        for (int i = 0; i &amp;lt; callbacks.length; i++) {&lt;br /&gt;
            if (callbacks[i] instanceof WSPasswordCallback) {&lt;br /&gt;
                WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];&lt;br /&gt;
                &lt;br /&gt;
                // for saml token , uses type unknown due to bug in wss4j&lt;br /&gt;
                if (pc.getUsage() == WSPasswordCallback.UNKNOWN) {&lt;br /&gt;
                    pc.setPassword(pass);&lt;br /&gt;
                }&lt;br /&gt;
                &lt;br /&gt;
            } else {&lt;br /&gt;
                throw new UnsupportedCallbackException(callbacks[i], &amp;quot;Unrecognized Callback&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now make web service calls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    recv.testAuthorization();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- Main.MikeSmorul - 12 Sep 2005&lt;/div&gt;</summary>
		<author><name>Scsong</name></author>
	</entry>
</feed>