cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache CXF > Fediz Jetty
Date Sun, 25 Nov 2012 21:39:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/2042/9/15/_/styles/combined.css?spaceKey=CXF&amp;forWysiwyg=true"
<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="">Fediz
    <h4>Page  <b>added</b> by             <a href="">Oliver
    <div class="notificationGreySide">
         <h1><a name="FedizJetty-JettyPlugin%281.1SNAPSHOT%29"></a>Jetty
Plugin (1.1 SNAPSHOT)</h1>
<p>This page describes how to enable Federation for a Jetty 7/8 instance hosting Relying
Party (RP) applications.  This configuration is not for a separate Tomcat instance hosting
the Fediz IDP and IDP STS WARs, or hosts for third-party applications that use Fediz STS-generated
SAML assertions for authentication.  After this configuration is done, the Jetty-RP instance
will validate the incoming SignInResponse created by the IDP server.</p>

<p>Prior to doing this configuration, make sure you've first deployed the Fediz IDP
and STS on the Tomcat IDP instance as discussed <a href="/confluence/display/CXF/Fediz+IDP"
title="Fediz IDP">here</a>, and can view the STS WSDL at the URL given on that page.
 That page also provides some tips for running multiple Tomcat instances on your machine.</p>

<h3><a name="FedizJetty-Installation"></a>Installation</h3>

<p>You can either build the Fediz plugin on your own or download the package <a href="/confluence/display/CXF/Fediz+Downloads"
title="Fediz Downloads">here</a>. If you have built the plugin on your own you'll
find the required libraries in <tt>plugins/jetty/target/</tt></p>

	<li>Create sub-directory <tt>fediz</tt> in <tt>${jetty.home}/lib/fediz</tt></li>
	<li>Update start.ini in ${jetty.home}/start.ini by adding <tt>fediz</tt>
to the OPTIONS
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
	<li>Deploy the libraries to the directory created in (1)</li>

<h3><a name="FedizJetty-Configuration"></a>Configuration</h3>

<h5><a name="FedizJetty-HTTPSconfiguration"></a>HTTPS configuration</h5>

<p>It's recommended to set up a dedicated (separate) Jetty instance for the Relying
Party. The Fediz RP web applications use the following TCP ports:</p>
	<li>HTTP port: 8080</li>
	<li>HTTPS port: 8443 (where IDP and STS are accessed)</li>

<p>These are the default ports for a standard Jetty installation.</p>

<p>The Relying Party must be accessed over HTTPS to protect the security tokens issued
by the IDP.</p>

<p>The Jetty HTTP(s) configuration is done in etc/jetty-ssl.xml.</p>

<p>The configuration is described in detail <a href=""
class="external-link" rel="nofollow">here</a></p>

<p>This page also describes how to create certificates.  Sample Jetty keystores (not
for production use, but useful for demoing Fediz and running the sample applications) are
provided in the examples/samplekeys folder of the Fediz distribution.  Note the Jetty keystore
here is different from the one used to configure the Tomcat-IDP instance.</p>

<p>To establish trust, there are significant keystore/truststore requirements between
the Servlet Container instances and the various web applications (IDP, STS, Relying party
applications, third party web services, etc.)  See <a href=""
class="external-link" rel="nofollow">this page</a> for more details, it lists the
trust requirements as well as sample scripts for creating your own (self-signed) keys.</p>

<p><b>Warning:  All sample keystores provided with Fediz (including in the WAR
files for its services and examples) are for development/prototyping use only.  They'll need
to be replaced for production use, at a minimum with your own self-signed keys but strongly
recommended to use third-party signed keys.</b></p>

<p>If you are currently just trying to run the Fediz samples, the configuration above
is all you need (the below configuration is already provided within the samples) so you can
return now to the samples' READMEs for the next steps in running them.</p>

<h5><a name="FedizJetty-FedizPluginconfigurationforYourWebApplication"></a>Fediz
Plugin configuration for Your Web Application</h5>

<p>The Fediz related configuration is done in a Servlet Container independent configuration
file which is described <a href="/confluence/display/CXF/Fediz+Configuration" title="Fediz

<p>The Fediz plugin requires configuring the FederationAuthenticator like any other
authenticator in Jetty. Detailed information about the Authenticators and SecurityHandler
is available <a href="" class="external-link"

<p>The Fediz configuration file allows to configure all servlet contexts in one file
or choosing one file per Servlet Context.</p>

<p>You can configure the context in context configuration file located in &lt;jetty.home&gt;/contexts.</p>

<h6><a name="FedizJetty-fedizhelloworld.xml"></a>fedizhelloworld.xml</h6>
<p>Hint: file name must be equal to war file name</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"> 
  <span class="code-tag">&lt;Get name=<span class="code-quote">"securityHandler"</span>&gt;</span>
    <span class="code-tag">&lt;Set name=<span class="code-quote">"loginService"</span>&gt;</span>
      <span class="code-tag">&lt;New class=<span class="code-quote">"org.apache.cxf.fediz.jetty.FederationLoginService"</span>&gt;</span>
        <span class="code-tag">&lt;Set name=<span class="code-quote">"name"</span>&gt;</span>WSFED<span
      <span class="code-tag">&lt;/New&gt;</span>
    <span class="code-tag">&lt;/Set&gt;</span>
    <span class="code-tag">&lt;Set name=<span class="code-quote">"authenticator"</span>&gt;</span>
      <span class="code-tag">&lt;New class=<span class="code-quote">"org.apache.cxf.fediz.jetty.FederationAuthenticator"</span>&gt;</span>
        <span class="code-tag">&lt;Set name=<span class="code-quote">"configFile"</span>&gt;</span><span
class="code-tag">&lt;SystemProperty name=<span class="code-quote">"jetty.home"</span>
default=<span class="code-quote">"."</span>/&gt;</span>/etc/fediz_config.xml<span
      <span class="code-tag">&lt;/New&gt;</span>
    <span class="code-tag">&lt;/Set&gt;</span>
  <span class="code-tag">&lt;/Get&gt;</span>

<p>The Fediz configuration file is a Servlet container independent configuration file
and described <a href="/confluence/display/CXF/Fediz+Configuration" title="Fediz Configuration">here</a></p>

<h3><a name="FedizJetty-WebApplicationdeployment"></a>Web Application deployment</h3>

<p>Deploy your Web Application to your Jetty installation (&lt;jetty.home&gt;/webapps).
 If you're running the Fediz examples, their README files will have instructions on how to
do this.</p>

<h3><a name="FedizJetty-FederationMetadatadocument"></a>Federation Metadata

<p>The Jetty Fediz plugin supports publishing the WS-Federation Metadata document which
is described <a href="/confluence/display/CXF/Fediz+Metadata" title="Fediz Metadata">here</a>.</p>

    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
       <a href="">View Online</a>
       <a href=";showCommentArea=true#addcomment">Add

View raw message