Re: Use pageparameters from authorized page to login
Hi Marieke, you could try to read page parameters before redirecting to interceptPage and build an instance of this page passing these parameters. Something like: //read parameters ...parameters = RequestCycle.get().getResquest().getQueryParameters() ; //convert parameters to PageParameters PageParameters pageParameters = ... //build an instance of interceptPage with page parameters interceptPage = new InterceptPage(pageParameters); pageMap.redirectToInterceptPage(interceptPage) Thanks for the answer, but I don't know how to get the PageParameters from the RequestCycle in the LoginPage, therefore some more information: - my application extends AuthenticatedWebApplication - the init of my Page1 or Page2 is never called because user is not authorized to see page (because not logged in) and therefore RestartResponseAtInterceptPageException is thrown. see AuthenticatedWebApplication:onUnauthorizedInstantiation => throw new RestartResponseAtInterceptPageException(getSignInPageClass()); - in RestartResponseAtInterceptPageException function redirectToInterceptPage is used which uses pageMap.redirectToInterceptPage(interceptPage) to go to LoginPage (=getSignInPageClass()). - No pageparameters are passed to the new request, so none are available in the LoginPage. Even not in the RequestCycle, because this is different from the initial one. Do we need to override onUnauthorizedInstantiation and pass the pageparameters pulled from RequestCycle? Thanks again. Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Use-pageparameters-from-authorized-page-to-login-tp3549134p3549188.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Use pageparameters from authorized page to login
Thanks for the answer, but I don't know how to get the PageParameters from the RequestCycle in the LoginPage, therefore some more information: - my application extends AuthenticatedWebApplication - the init of my Page1 or Page2 is never called because user is not authorized to see page (because not logged in) and therefore RestartResponseAtInterceptPageException is thrown. see AuthenticatedWebApplication:onUnauthorizedInstantiation => throw new RestartResponseAtInterceptPageException(getSignInPageClass()); - in RestartResponseAtInterceptPageException function redirectToInterceptPage is used which uses pageMap.redirectToInterceptPage(interceptPage) to go to LoginPage (=getSignInPageClass()). - No pageparameters are passed to the new request, so none are available in the LoginPage. Even not in the RequestCycle, because this is different from the initial one. Do we need to override onUnauthorizedInstantiation and pass the pageparameters pulled from RequestCycle? Thanks again. Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Use-pageparameters-from-authorized-page-to-login-tp3549134p3549188.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Use pageparameters from authorized page to login
Hi, You can always get the PageParameters from the page itself (given you received them in the constructor). In case you do not want to handle this on a page-by-page basis, they are also available through the RequestCycle (in wicket 1.4). You could check if the params contain "login" and "pass" keys, and if so, redirect to your login page with the current params. However, I hope you're aware that having the username and password in the url over http:// (instead of https://) makes accounts quite vulnerable. Bas *From:* Marieke Vandamme <mailto:marieke.vanda...@tvh.be> *Sent:* woensdag 25 mei 2011 1:11:50 *To:* users <mailto:users@wicket.apache.org> *Subject:* Use pageparameters from authorized page to login Hello, In my application all the pages are restricted using the MetaDataRoleAuthorizationStrategy. I want to give my user the ability to directly see the data from such a page using pageParameters: - http://www.mysite.com/page1.html?login=abc&pass=123 - http://www.mysite.com/page2.html?login=abc&pass=123 - ... When the page is constructed, wicket sees that the user is not logged in, so redirects to the loginpage (redirectToInterceptPage). There I want to use the pageparameters from the initial URL to do authorization and redirect back (continueToOriginalDestination). How can I get the pageparameters from the initial URL? Can't find them in request, not in pageparameters from loginpage, ... Thanks for any help ! Kind regards, Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Use-pageparameters-from-authorized-page-to-login-tp3549134p3549134.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Use pageparameters from authorized page to login
Hello, In my application all the pages are restricted using the MetaDataRoleAuthorizationStrategy. I want to give my user the ability to directly see the data from such a page using pageParameters: - http://www.mysite.com/page1.html?login=abc&pass=123 - http://www.mysite.com/page2.html?login=abc&pass=123 - ... When the page is constructed, wicket sees that the user is not logged in, so redirects to the loginpage (redirectToInterceptPage). There I want to use the pageparameters from the initial URL to do authorization and redirect back (continueToOriginalDestination). How can I get the pageparameters from the initial URL? Can't find them in request, not in pageparameters from loginpage, ... Thanks for any help ! Kind regards, Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Use-pageparameters-from-authorized-page-to-login-tp3549134p3549134.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org