Use pretty to build a security filter

Splash Forums PrettyFaces Users Use pretty to build a security filter

This topic contains 2 replies, has 2 voices, and was last updated by  nicog 6 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17810

    nicog
    Participant

    Hi,

    I’d like to build a global url pattern that allows an action to check if user is logged in and if no redirect to login page.

    I saw PrettyFaces examples that show this for one url mapping.

    My point is that I need a “super” url mapping that use all others url mapping..

    Something like

    <url-mapping id="security">
    <pattern value="/*" />
    <action>#{bean.checkUser}<action
    </url-mapping>

    <url-mapping id="admin">
    <pattern value="/admin" />
    <view-id>/admin.jsf</view-id>
    </url-mapping>

    Meaning that “security” url mapping id will be triggered before “admin” id and therefore redirect user if not logged and if pointing to /admin

    Is that possible with PrettyFaces.

    Thanks a lot for your answers

    Nico

    #20380

    @nicog: You have one real option right now.

    First:

    With version 3.1.1 (Currently 3.1.1-SNAPSHOT is available) you can add a ConfigurationPostProcessor which will add an Action to every URL-mapping:

    http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html/Extensions.html#ConfigurationPostProcessor

    In the postProcessor, you would need to loop over all the elements in the configuration and add a “new UrlAction()” to your desired mappings.

    We are currently working on supporting inheritable actions via prettyfaces configuration, but it’s a complex issue and will probably need to wait for 3.1.2.

    #20381

    nicog
    Participant

    there are great additional features in 3.1.1-SNAPSHOT!

    I will use this for sure to add it to all my mappings

    ConfigurationProvider is also great…job

    Thks a lot!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.