Results 1 to 7 of 7

Thread: AuthenticationProcessingFilter & JSF

  1. #1

    Default AuthenticationProcessingFilter & JSF

    Hi,

    I am trying to make my own implementation of the AuthenticationProcessingFilter in order to make it work with JSF.

    I have found a problem with doing that I cannot get to solve, mainly due to the fact that the filter gets executed before the faces context is created for the very first time the page is rendered.

    I mean, I have to configure the filter like this (with my own implementation):

    <bean id="authenticationProcessingFilter"
    class="com.motorfacil.portal.web.common.authentica tion.JSFAuthenticationProcessingFilter">
    <property name="authenticationManager">
    <ref local="authenticationManager" />
    </property>
    <property name="authenticationFailureUrl">
    <value>/login.jsp</value>
    </property>
    <property name="defaultTargetUrl">
    <value>/</value>
    </property>
    <property name="filterProcessesUrl">
    <value>/login.htm</value>
    </property>

    I cannot put the filterProcessesUrl to be /j_acegi_security_check because doesn't work with JSF.

    So the very first time /login.htm is invoked, i.e. when the page is first rendered, the filter gets invoked, but no JSF context is available.

    How can I solve this? The problem is the filter will always get invoked using a JSF mapping...

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Anyone out there have an answer to this? Sorry, but I haven't got any experience with JSF.

  3. #3
    Join Date
    Oct 2004
    Location
    Brazil
    Posts
    23

    Default

    Hello,

    I got ACEGI working with JSF by implementing the ACEGI authentication process inside a JSF managed bean. This bean has a reference to the authentication manager, and it does all the work which should be performed by the authentication filter. It also generates all the relevant JSF login error messages using the proper FacesMessages.

    Another approach would certainly be implementing your own filter, however that would require interecepting the appropriate URL and the appropriate form fields instead of the default ones.

    Regards,

    Victor

  4. #4
    Join Date
    Oct 2004
    Location
    Germany, Mainz
    Posts
    19

    Default

    Hi Victor,
    as I posted in your blog, I don't understand one step in your bean.

    Code:
    Authentication authReq = getAuthenticationRequest&#40;&#41;;
    I would be glad if you code post it.

    Thanks a lot!

    Johannes

  5. #5
    Join Date
    Oct 2004
    Location
    Brazil
    Posts
    23

    Default

    Hello Johannes,

    I've answered your doubts in my blog, please take a look there.

    Cheers,

    V.

  6. #6
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Hi Victor

    Would you please post your blog URL here, so people can find it easily?

    Thanks
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  7. #7
    Join Date
    Oct 2004
    Location
    Brazil
    Posts
    23

    Default

    Hello Ben,

    The URL is:

    http://www.jroller.com/page/vtatai/2...acegi_with_jsf

    It is the same listed on Acegi's site under "External Web Articles".

    Cheers,

    V.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •