Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

Commit

Permalink
Fix servlet-security instructions. Add add-user instructions, remove …
Browse files Browse the repository at this point in the history
…arguments from server start. Fix README.html.
  • Loading branch information
sgilda authored and pgier committed May 9, 2013
1 parent 1cf55aa commit db19553
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 14 deletions.
1 change: 0 additions & 1 deletion README.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ <h2 id="toc_2">Available Quickstarts </h2>
<tr><td align='left'><a href='cmt/README.html' title='cmt'>cmt</td><td align='left'> Container Managed Transactions (CMT), EJB</td><td align='left'>EJB that demonstrates container-managed transactions (CMT)</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-asynchronous/README.html' title='ejb-asynchronous'>ejb-asynchronous</td><td align='left'> EJB </td><td align='left'>Demonstrates asynchronous EJB invocations.</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-in-ear/README.html' title='ejb-in-ear'>ejb-in-ear</td><td align='left'> EAR, EJB</td><td align='left'>Packages an EJB JAR and WAR in an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-in-ear-bug910704/README.html' title='ejb-in-ear-bug910704'>ejb-in-ear-bug910704</td><td align='left'> EAR, EJB</td><td align='left'>Packages an EJB JAR and WAR in an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-in-war/README.html' title='ejb-in-war'>ejb-in-war</td><td align='left'> JSF, WAR, EJB</td><td align='left'>Packages an EJB JAR in a WAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-remote/README.html' title='ejb-remote'>ejb-remote</td><td align='left'> EJB</td><td align='left'>Shows how to access an EJB from a remote Java client program using JNDI</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-security/README.html' title='ejb-security'>ejb-security</td><td align='left'> Security, EJB</td><td align='left'>Shows how to use Java EE Declarative Security to Control Access to EJB 3</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
Expand Down
52 changes: 41 additions & 11 deletions servlet-security/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,46 @@ <h2 id="toc_3">Configure Maven</h2>

<p>If you have not yet done so, you must <a href="../README.html#mavenconfiguration">Configure Maven</a> before testing the quickstarts.</p>

<h2 id="toc_4">Define a Security Domain Using the Database JAAS Login Module</h2>
<h2 id="toc_4">Add the Application Users</h2>

<p>Using the add-user utility script, you must add the following users to the <code>ApplicationRealm</code>:</p>

<table><thead>
<tr>
<th align="left"><strong>UserName</strong></th>
<th align="left"><strong>Realm</strong></th>
<th align="left"><strong>Password</strong></th>
<th align="left"><strong>Roles</strong></th>
</tr>
</thead><tbody>
<tr>
<td align="left">quickstartUser</td>
<td align="left">ApplicationRealm</td>
<td align="left">quickstartPwd1!</td>
<td align="left">quickstarts</td>
</tr>
<tr>
<td align="left">guest</td>
<td align="left">ApplicationRealm</td>
<td align="left">guestPwd1!</td>
<td align="left">notauthorized</td>
</tr>
</tbody></table>

<p>The first application user has access rights to the application. The second application user is not authorized.</p>

<p>For an example of how to use the add-user utility, see instructions in the root README file located here: <a href="../README.html#addapplicationuser">Add User</a>.</p>

<h2 id="toc_5">Define a Security Domain Using the Database JAAS Login Module</h2>

<p>This quickstart authenticates users using a simple database setup. The datasource configuration is located in the <code>/src/main/webapp/WEB-INF/servlet-security-quickstart-ds.xml</code> file. You can configure the security domain using the JBoss CLI or by manually editing the configuration file.</p>

<h3 id="toc_5">Configure the Security Domain Using the JBoss CLI</h3>
<h3 id="toc_6">Configure the Security Domain Using the JBoss CLI</h3>

<ol>
<li><p>Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server with the web profile by typing the following: </p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME_SERVER_1</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="n">standaloneull</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME_SERVER_1</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="p">.</span><span class="n">xml</span>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span>
</pre>
</div></li>
<li><p>To start the JBoss CLI tool, open a new command line, navigate to the JBOSS_HOME directory, and type the following:</p>
Expand All @@ -72,7 +102,7 @@ <h3 id="toc_5">Configure the Security Domain Using the JBoss CLI</h3>
</div></li>
</ol>

<h3 id="toc_6">Configure the Security Domain Manually</h3>
<h3 id="toc_7">Configure the Security Domain Manually</h3>

<ol>
<li> If it is running, stop the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server.</li>
Expand All @@ -94,7 +124,7 @@ <h3 id="toc_6">Configure the Security Domain Manually</h3>

<p>Please note that the security domain name <code>servlet-security-quickstart</code> must match the one defined in the <code>/src/main/webapp/WEB-INF/jboss-web.xml</code> file.</p>

<h2 id="toc_7">Start JBoss Enterprise Application Platform 6 or JBoss AS 7 with the Web Profile</h2>
<h2 id="toc_8">Start JBoss Enterprise Application Platform 6 or JBoss AS 7 with the Web Profile</h2>

<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
Expand All @@ -107,7 +137,7 @@ <h2 id="toc_7">Start JBoss Enterprise Application Platform 6 or JBoss AS 7 with

<p><a id="buildanddeploy"></a></p>

<h2 id="toc_8">Build and Deploy the Quickstart</h2>
<h2 id="toc_9">Build and Deploy the Quickstart</h2>

<p><em>NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line. See <a href="../README.html#buildanddeploy">Build and Deploy the Quickstarts</a> for complete instructions and additional options.</em></p>

Expand All @@ -123,7 +153,7 @@ <h2 id="toc_8">Build and Deploy the Quickstart</h2>

<p><a id="accesstheapp"></a></p>

<h2 id="toc_9">Access the Application </h2>
<h2 id="toc_10">Access the Application </h2>

<p>The application will be running at the following URL <a href="http://localhost:8080/jboss-as-servlet-security/">http://localhost:8080/jboss-as-servlet-security/</a>.</p>

Expand All @@ -147,7 +177,7 @@ <h2 id="toc_9">Access the Application </h2>
</pre>
</div>

<h2 id="toc_10">Undeploy the Archive</h2>
<h2 id="toc_11">Undeploy the Archive</h2>

<ol>
<li>Make sure you have started the JBoss Server as described above.</li>
Expand All @@ -158,11 +188,11 @@ <h2 id="toc_10">Undeploy the Archive</h2>
</div></li>
</ol>

<h2 id="toc_11">Run the Quickstart in JBoss Developer Studio or Eclipse</h2>
<h2 id="toc_12">Run the Quickstart in JBoss Developer Studio or Eclipse</h2>

<p>You can also start the server and deploy the quickstarts from Eclipse using JBoss tools. For more information, see <a href="../README.html#useeclipse">Use JBoss Developer Studio or Eclipse to Run the Quickstarts</a> </p>

<h2 id="toc_12">Debug the Application</h2>
<h2 id="toc_13">Debug the Application</h2>

<p>If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.</p>
<div class="highlight"><pre> <span class="n">mvn</span> <span class="n">dependency</span><span class="p">:</span><span class="n">sources</span>
Expand Down
19 changes: 17 additions & 2 deletions servlet-security/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ Configure Maven
If you have not yet done so, you must [Configure Maven](../README.md#mavenconfiguration) before testing the quickstarts.


Add the Application Users
----------------

Using the add-user utility script, you must add the following users to the `ApplicationRealm`:

| **UserName** | **Realm** | **Password** | **Roles** |
|:-----------|:-----------|:-----------|:-----------|
| quickstartUser| ApplicationRealm | quickstartPwd1!| quickstarts |
| guest | ApplicationRealm | guestPwd1! | notauthorized |

The first application user has access rights to the application. The second application user is not authorized.

For an example of how to use the add-user utility, see instructions in the root README file located here: [Add User](../README.md#addapplicationuser).


Define a Security Domain Using the Database JAAS Login Module
---------------

Expand All @@ -56,8 +71,8 @@ This quickstart authenticates users using a simple database setup. The datasourc

1. Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server with the web profile by typing the following:

For Linux: JBOSS_HOME_SERVER_1/bin/standalone.sh -c standaloneull.xml
For Windows: JBOSS_HOME_SERVER_1\bin\standalone.bat -c standalone.xml
For Linux: JBOSS_HOME/bin/standalone.sh
For Windows: JBOSS_HOME\bin\standalone.bat
2. To start the JBoss CLI tool, open a new command line, navigate to the JBOSS_HOME directory, and type the following:

For Linux: bin/jboss-cli.sh --connect
Expand Down

0 comments on commit db19553

Please sign in to comment.