Example #1
0
 /**
  * Cache the requested protected resource pending successful authentication.
  *
  * @param pageClass
  */
 public void cacheRequest(Class<? extends Page> pageClass) {
   // build absolute url with correctly encoded parameters?!
   Request req = WebRequestCycle.get().getRequest();
   Map<String, ?> params = req.getRequestParameters().getParameters();
   PageParameters pageParams = new PageParameters(params);
   String relativeUrl = WebRequestCycle.get().urlFor(pageClass, pageParams).toString();
   requestUrl = RequestUtils.toAbsolutePath(relativeUrl);
   if (isTemporary()) {
     // we must bind the temporary session into the session store
     // so that we can re-use this session for reporting an error message
     // on the redirected page and continuing the request after
     // authentication.
     bind();
   }
 }
Example #2
0
  private boolean handleUsernamePasswordParameters() {
    String iframeLoginUsername = RequestCycle.get().getRequest().getParameter("iframe_username");
    String iframeLoginPassword = RequestCycle.get().getRequest().getParameter("iframe_password");

    if (iframeLoginUsername != null && iframeLoginPassword != null) {
      boolean valid = ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
      if (valid) {
        ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
        WebRequestCycle.get().setResponsePage(SearchFormPage.class);
        return true;
      }
    }
    return false;
  }