PageBeforeAuthententicationRequiredPage:

...onSubmit {
     setResponsePage(MyPageThatRequiresAnAuthenticatedUser.class);
     setRedirect(true)
}

johan


On 10/31/06, Andrew Berman <[EMAIL PROTECTED]> wrote:
Hey Guys,

This is the way I have it working.....Unfortunately I'm so swamped with work so I can't put together a QuickStart right now, but maybe within the next couple weeks.

MyApplication:

getSecuritySettings().setAuthorizationStrategy(
                new IAuthorizationStrategy() {
                    @SuppressWarnings("unchecked")
                    public boolean isInstantiationAuthorized(
                            Class componentClass) {
                        if (WebPage.class.isAssignableFrom(componentClass)) {
                            if (SignInRequired.class
                                    .isAssignableFrom(componentClass)) {
                                if (!MySession.get().isAuthenticated())
                                    throw new RestartResponseAtInterceptPageException(
                                            SignInPage.class );
                            }
                        }
                        return true;
                    }

                    public boolean isActionAuthorized(Component component,
                            Action action) {
                        return true;
                    }

                });

PageBeforeAuthententicationRequiredPage:

...onSubmit {
     setResponsePage(MyPageThatRequiresAnAuthenticatedUser.class);
}

MyPageThatRequiresAnAuthenticatedUser:

MyPageThatRequiresAnAuthenticatedUser implements SignInRequired {
     ....
}

SignInPage:

...continueToOriginalDestination();

So, when I go to the MyPageThatRequiresAnAuthenticatedUser page when I'm not authenticated, it does go to the SignInPage, but after I authenticate, it goes back to PageBeforeAuthententicationRequiredPage instead of MyPageThatRequiresAnAuthenticatedUser.

Hope this helps you understand things and thanks again for your help,

Andrew


On 10/28/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
yep, how about a quickstart

-igor



On 10/28/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
so in the onsubmit you first redirect to another page
And in the constructor of that page you check it it is signed in?
And if not then you throw that restart exception?
That should work fine.

johan



On 10/28/06, Andrew Berman <[EMAIL PROTECTED] > wrote:
Igor,

For the onSubmit of the form's button, though, I do a setResponsePage(MyPageThatRequiresSignIn.class);

So shouldn't the original destination be the page I'm trying to go to?

--Andrew


On 10/27/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
original destination is the url - the page that the form is on

the exception does not remember params submitted via post - this does pop up now and then, any reason why you dont do the auth check before the form submit? thats the easy way out

the hard way out is to submit an rfe to our jira, and even better a patch

-igor


On 10/27/06, Andrew Berman < [EMAIL PROTECTED]> wrote:
Hello,

Here is my setup:

1.  I have an AuthorizationStrategy which checks a page to see if the SIgnIn is required.  If it is, it throws a RestartResponseAtInterceptPageException to my SignInPage.
2.  I have a page which has a form which does some validation and when you click submit it goes to a page that requires the user to be logged in and it hits the AuthStrategy I wrote in #1.

The problem I'm having is that when you click submit on the form (with no validation errors), and then go to the signin page, and then actually sign in, it takes me back to the form page with a validation error saying that the fields are not filled in.  Why is it not going to the original destination?

Thanks,

Andrew

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to