cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Wulff (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache CXF > Fediz Extensions
Date Sun, 10 Nov 2013 19:54:02 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/de/2176/1/15/_/styles/combined.css?spaceKey=CXF&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CXF/Fediz+Extensions">Fediz
Extensions</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~owulff@apache.org">Oliver
Wulff</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >| freshness | wfresh | FreshnessCallback
| 1.0.2 | <br>| realm | wtrealm | RealmCallback | 1.1.0 | <br></td></tr>
            <tr><td class="diff-changed-lines" >| N.A. | <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">N.A.</span>
<span class="diff-added-words"style="background-color: #dfd;">any</span> | SignInQueryCallback
| 1.1.0 | <br></td></tr>
            <tr><td class="diff-unchanged" > <br>If you configure a class
which implements the interface {{javax.security.auth.callback.CallbackHandler}} 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 {{HttpServletRequest}} object which might give
you the required information to resolve the value. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="FedizExtensions-FedizExtensions"></a>Fediz Extensions</h1>
<p>This page describes the extension points in Fediz to enrich its functionality further.</p>

<h3><a 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 href="/confluence/display/CXF/Fediz+Configuration"
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 class='confluenceTh'>XML element </th>
<th class='confluenceTh'>Query parameter </th>
<th class='confluenceTh'>Callback class </th>
<th class='confluenceTh'>Supported version</th>
</tr>
<tr>
<td class='confluenceTd'> authenticationType </td>
<td class='confluenceTd'> wauth </td>
<td class='confluenceTd'> WAuthCallback </td>
<td class='confluenceTd'> 1.0.0 </td>
</tr>
<tr>
<td class='confluenceTd'> homeRealm </td>
<td class='confluenceTd'> whr </td>
<td class='confluenceTd'> HomeRealmCallback </td>
<td class='confluenceTd'> 1.0.0 </td>
</tr>
<tr>
<td class='confluenceTd'> issuer </td>
<td class='confluenceTd'> N.A. </td>
<td class='confluenceTd'> IDPCallback </td>
<td class='confluenceTd'> 1.0.0 </td>
</tr>
<tr>
<td class='confluenceTd'> freshness </td>
<td class='confluenceTd'> wfresh </td>
<td class='confluenceTd'> FreshnessCallback </td>
<td class='confluenceTd'> 1.0.2 </td>
</tr>
<tr>
<td class='confluenceTd'> realm </td>
<td class='confluenceTd'> wtrealm </td>
<td class='confluenceTd'> RealmCallback </td>
<td class='confluenceTd'> 1.1.0 </td>
</tr>
<tr>
<td class='confluenceTd'> N.A. </td>
<td class='confluenceTd'> any </td>
<td class='confluenceTd'> SignInQueryCallback </td>
<td class='confluenceTd'> 1.1.0 </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="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
...
        &lt;protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="federationProtocolType"
version="1.2"&gt;
            ...
            &lt;homeRealm type="Class" value="MyCallbackHandler " /&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="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
public class MyCallbackHandler implements CallbackHandler {
    
    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
        for (int i = 0; i &lt; callbacks.length; i++) {
            if (callbacks[i] instanceof HomeRealmCallback) {
                HomeRealmCallback callback = (HomeRealmCallback) callbacks[i];
                HttpServletRequest request = callback.getRequest();
                String homeRealm = ...
                callback.setHomeRealm(homeRealm);
            } else {
                throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
            }
        }
    }
}
</pre>
</div></div>


<h3><a name="FedizExtensions-CustomTokenValidator"></a>Custom Token Validator</h3>

<p>todo</p>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CXF">Stop
watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email notification preferences</a>
</div>
        <a href="https://cwiki.apache.org/confluence/display/CXF/Fediz+Extensions">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27848884&revisedVersion=5&originalVersion=4">View
Changes</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message