0

Spring Security Integraton - popup modal login form?

asked 2009-02-21 06:31:26 +0800

davout gravatar image davout
1435 3 18

updated 2009-02-21 06:31:59 +0800

I'm planning to add Spring Security integration to my ZK web app.

Looking at the Spring Security configuration parameters there is a 'login' option that allows you to specify a login URL to present a login form. Instead of using a seperate URL, is it possible to create a popup modal login form instead?

In my own app a user may access various aspects of the web app, and is only prompted to login if they try to add/edit data. For instance: using the ZK 'intercept-event' approach I want to have a popup modal login form appear after they click on the 'add' buton.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-02-21 11:07:28 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2009-02-21 11:08:24 +0800

@davout

like on other side i said. The simplest thing is to catch in the onClick$BtnAdd(Event event) with a

  public void  onClick$BtnAdd(Event event) {
    
      // if ( isAllowed("btnAdd") ){
     if ( isAllowed("ROLE_USER") ){
        // do something

      } else {

         // go to the login
         Executions.Redirect("/spring_security_login");
         }
     }

whises
Stephan

link publish delete flag offensive edit

answered 2009-02-21 21:04:46 +0800

davout gravatar image davout
1435 3 18

No, that would require code for every button in the app. Instead I want to use the intercept configuration method and have a response that force a popup modal login form.

link publish delete flag offensive edit

answered 2009-02-23 10:31:16 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2009-02-23 10:34:42 +0800

hmm,

you can only secure the needed buttons.

The other way you would go is in the sample springSecurityContext.xml too.
Have a look at the end of the file.

  xmlns:zksp="http://www.zkoss.org/2008/zkspring"

   ...

   <zksp:zk-event login-template-close-delay="5">
     <zksp:intersept-event path"//**/btnAddThis event="onClick" access="IS_AUTHENTICATED_REMEMBERED" >
     <zksp:intersept-event path"/** event="onClick" access="IS_AUTHENTICATED_ANYNYMOUSLY" >
   </zksp:zk-event>

regards
Stephan

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-21 06:31:26 +0800

Seen: 561 times

Last updated: Feb 23 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More