[jboss-cvs] jboss-seam/doc/reference/en/modules ...

Shane Bryzak sbryzak at redhat.com
Tue Nov 13 20:58:53 EST 2007


  User: sbryzak2
  Date: 07/11/13 20:58:53

  Modified:    doc/reference/en/modules  security.xml
  Log:
  JBSEAM-1421
  
  Revision  Changes    Path
  1.85      +48 -0     jboss-seam/doc/reference/en/modules/security.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: security.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/security.xml,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -b -r1.84 -r1.85
  --- security.xml	8 Nov 2007 07:49:02 -0000	1.84
  +++ security.xml	14 Nov 2007 01:58:52 -0000	1.85
  @@ -1449,4 +1449,52 @@
       
     </sect1>
   
  +  <sect1>
  +    <title>Extending the Identity component</title>
  +    
  +    <para>
  +      Sometimes it might be necessary to extend the Identity component if your application has
  +      special security requirements.  For example, users might be required to authenticate using
  +      a Company or Department ID, along with their usual username and password.  If permission-based
  +      security is required then RuleBasedIdentity should be extended, otherwise Identity should be
  +      extended.
  +    </para>  
  +    
  +    <para>
  +      The following example shows an extended Identity component with an additional 
  +      <literal>companyCode</literal> field.  The install precendence of <literal>APPLICATION</literal>
  +      ensures that this extended Identity gets installed in preference to the built-in Identity.
  +    </para>
  +    
  +    <programlisting><![CDATA[@Name("org.jboss.seam.security.identity")
  + at Scope(SESSION)
  + at Install(precedence = APPLICATION)
  + at BypassInterceptors
  + at Startup
  +public class CustomIdentity extends Identity
  +{
  +   private static final LogProvider log = Logging.getLogProvider(CustomIdentity.class);
  +
  +   private String companyCode;
  +   
  +   public String getCompanyCode()
  +   {
  +      return companyCode;
  +   }
  +   
  +   public void setCompanyCode(String companyCode)
  +   {
  +      this.companyCode = companyCode;
  +   }
  +   
  +   @Override
  +   public String login()
  +   {
  +      log.info("###### CUSTOM LOGIN CALLED ######");
  +      return super.login();
  +   }
  +}]]></programlisting>    
  +
  +  </sect1>
  +
   </chapter>
  
  
  



More information about the jboss-cvs-commits mailing list