<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
PicketBox Security Annotations
</h3>
<span style="margin-bottom: 10px;">
modified by <a href="https://community.jboss.org/people/ozizka">Ondrej Zizka</a> in <i>PicketBox Development</i> - <a href="https://community.jboss.org/docs/DOC-14926">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p><< <a class="jive-link-wiki-small" href="https://community.jboss.org/docs/DOC-14744">Go Back to PicketBox Overview</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h3 id="Project_PicketBox">Project:  <a class="jive-link-external-small" href="http://jboss.org/picketbox">PicketBox</a></h3><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><div class="toc" style="border: 1px dashed black; padding: 10px;"><ul><ul><ul><li>
<a class="jive-link-anchor-small" href="#Project_PicketBox">Project:  PicketBox</a>
</li>
</ul></ul><ul><li>
<a class="jive-link-anchor-small" href="#SecurityDomain_Annotation">@SecurityDomain Annotation</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Authentication_Annotation">@Authentication Annotation</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Authorization_Annotation">@Authorization Annotation</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#SecurityMapping_Annotation">@SecurityMapping Annotation</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#SecurityAudit_Annotation">@SecurityAudit Annotation</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Module_Annotation">@Module Annotation</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#ModuleOption_Annotation">@ModuleOption Annotation</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#SecurityConfig_Annotation">@SecurityConfig Annotation</a>
</li>
</ul></ul></div></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here we describe the various security annotations available as part of PicketBox.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h2 id="SecurityDomain_Annotation">@SecurityDomain Annotation</h2><p>Fully Qualified Name:  org.jboss.security.annotation.SecurityDomain</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>value: a name indicating the security domain.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h2 id="Authentication_Annotation">@Authentication Annotation</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Fully Qualified Name:  org.jboss.security.annotation.Authentication</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>modules: an array of @Module  annotations.  This is not optional.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">@Authentication(modules=<font color="navy">{</font>@Module(code = UsersRolesLoginModule.class, options = <font color="navy">{</font>@ModuleOption<font color="navy">}</font>)<font color="navy">}</font>)
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> AuthenticationAnnotatedPOJO
<font color="navy">{</font>
<font color="navy">}</font>
</code></pre><h2></h2><h2 id="Authorization_Annotation">@Authorization Annotation</h2><p>Fully Qualified Name:  org.jboss.security.annotation.Authorization</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>modules: an array of @Module  annotations. This is not optional.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">@Authentication(modules=<font color="navy">{</font>@Module(code = UsersRolesLoginModule.class, options = <font color="navy">{</font>@ModuleOption<font color="navy">}</font>)<font color="navy">}</font>)
@Authorization(modules =<font color="navy">{</font>@Module(code = PicketBoxAuthorizationModule.class, options =
   <font color="navy">{</font>@ModuleOption(key=<font color="red">"roles"</font>,value=<font color="red">"validuser"</font>)<font color="navy">}</font>)<font color="navy">}</font>)
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> AuthAuthorizationAnnotatedPOJO
<font color="navy">{</font>
  
<font color="navy">}</font>
</code></pre><h2></h2><h2 id="SecurityMapping_Annotation">@SecurityMapping Annotation</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Fully Qualified Name:  org.jboss.security.annotation.SecurityMapping</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>modules: an array of @Module  annotations. This is not optional.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">@Authentication(modules =
<font color="navy">{</font>@Module(code = UsersRolesLoginModule.class, options =
<font color="navy">{</font>@ModuleOption<font color="navy">}</font>)<font color="navy">}</font>)
 
@SecurityMapping(modules =
<font color="navy">{</font>@Module(code = OptionsRoleMappingProvider.class, type=<font color="red">"role"</font>, options =
<font color="navy">{</font>@ModuleOption(key=<font color="red">"rolesMap"</font>,value=<font color="red">"validuser=AuthorizedUser,InternalUser"</font>, valueType=VALUE_TYPE.JAVA_PROPERTIES),
      @ModuleOption(key=<font color="red">"replaceRoles"</font>, value=<font color="red">"false"</font>)<font color="navy">}</font>)<font color="navy">}</font>)
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> AuthPlusMappingAnnotatedPOJO
<font color="navy">{</font>
<font color="navy">}</font>
</code></pre><h2 id="SecurityAudit_Annotation">@SecurityAudit Annotation</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Fully Qualified Name:  org.jboss.security.annotation.SecurityMapping</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>modules: an array of @Module  annotations. This is not optional.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">@SecurityDomain(value=<font color="red">"role-mapping-test"</font>)
@SecurityAudit
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> SecurityMappingAnnotationRolePOJO
<font color="navy">{</font>
<font color="navy">}</font>
</code></pre><h2 id="Module_Annotation">@Module Annotation</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Fully Qualified Name: org.jboss.security.annotation.Module</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>code : the class of the module (Eg: UsersRolesLoginModule.class) This represents the JAAS login module for @Authentication, Policy Module for @Authorization, Mapping provider for @SecurityMapping and Audit Provider for @Audit</li><li>flag : one of (REQUIRED,REQUISITE,SUFFICIENT,OPTIONAL).  Default, REQUIRED is assumed.  This is the behavior defined in the JAAS configuration for login modules. (Optional)</li><li>type: an additional type value provided (mainly, for mapping modules).  Default: ""  (Optional)</li><li>options: an array of @ModuleOption  annotations</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h2></h2><h2 id="ModuleOption_Annotation">@ModuleOption Annotation</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Fully Qualified Name: org.jboss.security.annotation.ModuleOption</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>key : key of the option being passed to the module</li><li>value : value of the options being passed to the module</li><li>valueType : whether the value is a regular string or assumed as a Java properties. Default is plain string.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h2></h2><h2 id="SecurityConfig_Annotation">@SecurityConfig Annotation</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Fully Qualified Name: org.jboss.security.annotation.ModuleOption</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It contains:</p><ul><li>fileName:  name of the xml config file that defines the security domain configuration</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><< <a class="jive-link-wiki-small" href="https://community.jboss.org/docs/DOC-14744">Go Back to PicketBox Overview</a></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Comment by <a href="https://community.jboss.org/docs/DOC-14926">going to Community</a></p>
        <p style="margin: 0;">Create a new document in PicketBox Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2088">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>