Acegi integration

(Difference between revisions)
Jump to: navigation, search
m (category added)
Line 1: Line 1:
 +
[[Category:Extending OpenCms]]
 
== Integrating Spring Acegi into OpenCms to restrict access for Web Users. ==
 
== Integrating Spring Acegi into OpenCms to restrict access for Web Users. ==
 
  
 
1. Spring Framework needs to be integrated before we can continue. [link to another page here]
 
1. Spring Framework needs to be integrated before we can continue. [link to another page here]
Line 6: Line 6:
 
2. Crate applicationContext-acegi-security.xml
 
2. Crate applicationContext-acegi-security.xml
  
<code>
+
<code>
  
 
   <beans>
 
   <beans>
Line 71: Line 71:
 
                 CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
 
                 CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
 
                 PATTERN_TYPE_APACHE_ANT
 
                 PATTERN_TYPE_APACHE_ANT
                /**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,exceptionTranslationFilter,filterSecurityInterceptor
+
                  /**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,exceptionTranslationFilter,filterSecurityInterceptor
 
             </value>
 
             </value>
 
         </property>
 
         </property>
Line 132: Line 132:
 
     </beans>
 
     </beans>
  
</code>
+
</code>
  
  
 
3. modify opencms/WEB-INF/web.xml
 
3. modify opencms/WEB-INF/web.xml
  
<code>
+
<code>
 
     <taglib>
 
     <taglib>
 
         <taglib-uri>http://acegisecurity.org/authz</taglib-uri>
 
         <taglib-uri>http://acegisecurity.org/authz</taglib-uri>
Line 187: Line 187:
 
         </param-value>
 
         </param-value>
 
     </context-param>
 
     </context-param>
</code>
+
</code>
  
 
4. create acegilogin.jsp in opencms workplace
 
4. create acegilogin.jsp in opencms workplace
  
<nowiki>
+
<nowiki>
<code>
+
<code>
  
 
     <h1>Acegi Login</h1>
 
     <h1>Acegi Login</h1>
Line 215: Line 215:
 
     </form>
 
     </form>
  
</code>
+
</code>
</nowiki>
+
</nowiki>
  
  

Revision as of 21:32, 27 June 2007

Integrating Spring Acegi into OpenCms to restrict access for Web Users.

1. Spring Framework needs to be integrated before we can continue. [link to another page here]

2. Crate applicationContext-acegi-security.xml

Invalid language.

You need to specify a language like this: <source lang="html">...</source>

Supported languages for syntax highlighting:

actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp, cpp-qt, csharp, css, d, delphi, diff, div, dos, eiffel, fortran, freebasic, gml, groovy, html4strict, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, matlab, mirc, mpasm, mysql, nsis, objc, ocaml, ocaml-brief, oobas, oracle8, pascal, perl, php, php-brief, plsql, python, qbasic, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, z80


3. modify opencms/WEB-INF/web.xml

Invalid language.

You need to specify a language like this: <source lang="html">...</source>

Supported languages for syntax highlighting:

actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp, cpp-qt, csharp, css, d, delphi, diff, div, dos, eiffel, fortran, freebasic, gml, groovy, html4strict, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, matlab, mirc, mpasm, mysql, nsis, objc, ocaml, ocaml-brief, oobas, oracle8, pascal, perl, php, php-brief, plsql, python, qbasic, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, z80

4. create acegilogin.jsp in opencms workplace

 <code>

    <h1>Acegi Login</h1>
    <%-- this form-login-page form is also used as the 
         form-error-page to ask for a login again.
         --%>
    <c:if test="${not empty param.login_error}">
      <font color="red">
        Your login attempt was not successful, try again.<BR><BR>
        Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>
      </font>
    </c:if>
    <form id="loginForm" action="<c:url value='j_acegi_security_check'/>" method="POST">
      <table>
        <tr><td>User:</td><td><input type='text' name='j_username' 
        <c:if test="${not empty param.login_error}">
              value='<%= session.getAttribute(AuthenticationProcessingFilter.ACEGI_SECURITY_LAST_USERNAME_KEY) %>'
       </c:if>></td></tr>
        <tr><td>Password:</td><td><input type='password' name='j_password'></td></tr>
        <tr><td colspan='2'><input name="submit" type="submit"></td></tr>
      </table>
    </form>

 </code>
 


5. Add the following jar's in the opencms/WEB-INF/lib/*

  • acegi-security-1.0.3.jar
  • aopalliance-1.0.jar
  • asm-1.5.3.jar
  • asm-all-2.2.3.jar
  • asm-attrs-1.5.3.jar
  • aspectjrt-1.5.2a.jar
  • cglib-2.1_3.jar
  • cglib-nodep-2.1_3.jar
  • commons-lang-2.1.jar
  • hibernate-3.2.1.ga.jar
  • spring-2.0.jar
  • standard-1.1.2.jar



Contact me on the OpenCms mailing list if you have questions... Mick Knutson

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox