You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2012/10/24 22:47:31 UTC

svn commit: r836063 - in /websites/production/cxf/content: cache/main.pageCache fediz-extensions.html

Author: buildbot
Date: Wed Oct 24 20:47:30 2012
New Revision: 836063

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/main.pageCache
    websites/production/cxf/content/fediz-extensions.html

Modified: websites/production/cxf/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/fediz-extensions.html
==============================================================================
--- websites/production/cxf/content/fediz-extensions.html (original)
+++ websites/production/cxf/content/fediz-extensions.html Wed Oct 24 20:47:30 2012
@@ -141,7 +141,57 @@ Apache CXF -- Fediz Extensions
 
 <h3><a shape="rect" name="FedizExtensions-CallbackHandler"></a>Callback Handler</h3>
 
+<p>The Sign-In request (Redirect URL) to the IDP contains several query parameters to customize the sign in process. Some parameters are configured statically in the <a shape="rect" href="fediz-configuration.html" title="Fediz Configuration">Fediz configuration file</a> some others can be resolved at runtime when the initial request is received by the Fediz plugin.</p>
+
+<p>The following table gives an overview of the parameters which can be resolved at runtime. It contains the XML element name of the Fediz configuration file, the query parameter name of the sign-in request to the IDP as well as the Callback class.</p>
+
+<div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">XML element </th><th colspan="1" rowspan="1" class="confluenceTh">Query parameter </th><th colspan="1" rowspan="1" class="confluenceTh">Callback class </th><th colspan="1" rowspan="1" class="confluenceTh">Supported version</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> authenticationType </td><td colspan="1" rowspan="1" class="confluenceTd"> wauth </td><td colspan="1" rowspan="1" class="confluenceTd"> WAuthCallback </td><td colspan="1" rowspan="1" class="confluenceTd"> 1.0.0 </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> homeRealm </td><td colspan="1" rowspan="1" class="confluenceTd"> whr </td><td colspan="1" rowspan="1" class="confluenceTd"> HomeRealmCallback </td><td colspan="1" rowspan="1" class="confluenceTd"> 1.0.0 </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> issuer </td><td colspan="1" rowspan="1" class="confluenceTd"> N.A. </td
 ><td colspan="1" rowspan="1" class="confluenceTd"> IDPCallback </td><td colspan="1" rowspan="1" class="confluenceTd"> 1.0.0 </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> freshness </td><td colspan="1" rowspan="1" class="confluenceTd"> wfresh </td><td colspan="1" rowspan="1" class="confluenceTd"> FreshnessCallback </td><td colspan="1" rowspan="1" class="confluenceTd"> 1.0.2 </td></tr></tbody></table>
+</div>
+
+
+<p>If you configure a class which implements the interface <tt>javax.security.auth.callback.CallbackHandler</tt> you get the corresponding Callback object where you must set the value which is then added to the query parameter. The Callback object provides the <tt>HttpServletRequest</tt> object which might give you the required information to resolve the value.</p>
+
+<p>Here is a snippet of the configuration to configure a CallbackHandler:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+...
+        &lt;protocol xmlns:xsi=<span class="code-quote">"http:<span class="code-comment">//www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"federationProtocolType"</span> version=<span class="code-quote">"1.2"</span>&gt;
+</span>            ...
+            &lt;homeRealm type=<span class="code-quote">"<span class="code-object">Class</span>"</span> value=<span class="code-quote">"MyCallbackHandler "</span> /&gt;
+            ...
+        &lt;/protocol&gt;
+...
+</pre>
+</div></div>
+
+<p>And a sample implementation of the CallbackHandler:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">public</span> class MyCallbackHandler <span class="code-keyword">implements</span> CallbackHandler {
+    
+    <span class="code-keyword">public</span> void handle(Callback[] callbacks) <span class="code-keyword">throws</span> IOException, UnsupportedCallbackException {
+        <span class="code-keyword">for</span> (<span class="code-object">int</span> i = 0; i &lt; callbacks.length; i++) {
+            <span class="code-keyword">if</span> (callbacks[i] <span class="code-keyword">instanceof</span> HomeRealmCallback) {
+                HomeRealmCallback callback = (HomeRealmCallback) callbacks[i];
+                HttpServletRequest request = callback.getRequest();
+                <span class="code-object">String</span> homeRealm = ...
+                callback.setHomeRealm(homeRealm);
+            } <span class="code-keyword">else</span> {
+                <span class="code-keyword">throw</span> <span class="code-keyword">new</span> UnsupportedCallbackException(callbacks[i], <span class="code-quote">"Unrecognized Callback"</span>);
+            }
+        }
+    }
+}
+</pre>
+</div></div>
+
+
 <h3><a shape="rect" name="FedizExtensions-CustomTokenValidator"></a>Custom Token Validator</h3>
+
+<p>todo</p>
 </div>
            </div>
            <!-- Content -->