the auth strategy runs before your class is instantiated, so check there for the parameter being present and log the user in.
-igor On Fri, Dec 11, 2009 at 1:58 PM, tubin gen <[email protected]> wrote: > My application does not authenticate user ,some external application > authenticates and redirects to my application passing a parameter to > identify the user, using this parameter I have to create a session and > userdetails. > > I am using SimplePageAuthrizationStrategy > > > getSecuritySettings().setAuthorizationStrategy(new > SimplePageAuthorizationStrategy(BasePage.class,getSignInPageClass()){ > �...@override > protected boolean isAuthorized() { > return ((AuditWebSession)Session.get()).isSignedIn(); > //return true; > } > }); > > > here my SignInPage > > public class SSIIntegrationLogin extends WebPage { > > private String sessionId; > > public SSIIntegrationLogin(PageParameters pageParameters) { > > sessionId=getRequestCycle().getRequest().getParameter(Parameters.PARAM_SSI_SESSION_ID); > if (signIn(sessionId)){ > onSignInSucceeded(); > }else{ > onSignInFailed(); > } > } > > protected void onSignInFailed() > { > setRedirect(true); > setResponsePage(SingInFailedPage.class); > } > > > public boolean signIn(String sessionId) > { > return AuthenticatedWebSession.get().signIn(sessionId,""); > } > > protected void onSignInSucceeded() > { > // If login has been called because the user was not yet > // logged in, than continue to the original destination, > // otherwise to the Home page > if (!continueToOriginalDestination()) > { > setRedirect(true); > > setResponsePage(getApplication().getSessionSettings().getPageFactory().newPage( > getApplication().getHomePage(), (PageParameters)null)); > } > } > > } > > the problem is getting the parameter PARAM_SSI_SESSION_ID the external > application will redirect to a link like > http://hostname/myapp?PARAM_SSI_SESSION_ID=tert > > > any request to my application will be first cheked by authorization and > becasue the user is not signed in he will be redirected to SingInpage in my > case SSIIntegrationLogin , here I need the parameter > PARAM_SSI_SESSION_Id > now I was expecting the above code to work but I never get the parameter > PARAM_SSI_SESSION_Id , please tell me how can I get this parameter ? or is > there any beter way to handle this ? > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
