Ejemplo n.º 1
0
  public BasePage(PageParameters param, String titleKey) {
    super(param);

    if (param != null && !param.isEmpty()) {
      try {
        if (param.containsKey("id")) {
          id = param.getLong("id");
        }
      } catch (StringValueConversionException exc) {
        exc.printStackTrace();
      }
    }

    initialize(titleKey);
  }
 /**
  * Constructor called by Wicket with an auth response (since the response has parameters
  * associated with it... LOTS of them!). And, by the way, the auth response is the Request for
  * this classl (not to be confusing).
  *
  * @param pageParameters The request parameters (which are the response parameters from the OP).
  */
 public OpenIdRegistrationSavePage(final PageParameters pageParameters) {
   RegistrationModel registrationModel = new RegistrationModel();
   if (!pageParameters.isEmpty()) {
     //
     // If this is a return trip (the OP will redirect here once authentication
     /// is compelete), then verify the response. If it looks good, send the
     /// user to the RegistrationSuccessPage. Otherwise, display a message.
     //
     final String isReturn = pageParameters.getString("is_return");
     if (isReturn.equals("true")) {
       //
       // Grab the session object so we can let openid4java do verification.
       //
       final MakotoOpenIdAwareSession session = (MakotoOpenIdAwareSession) getSession();
       final DiscoveryInformation discoveryInformation = session.getDiscoveryInformation();
       //
       // Delegate to the Service object to do verification. It will return
       /// the RegistrationModel to use to display the information that was
       /// retrieved from the OP about the User-Supplied identifier. The
       /// RegistrationModel reference will be null if there was a problem
       /// (check the logs for more information if this happens).
       //
       registrationModel =
           RegistrationService.processReturn(
               discoveryInformation, pageParameters, RegistrationService.getReturnToUrl());
       if (registrationModel == null) {
         //
         // Oops, something went wrong. Display a message on the screen.
         /// Check the logs for more information.
         //
         error(
             "Open ID Confirmation Failed. No information was retrieved from the OpenID Provider. You will have to enter all information by hand into the text fields provided.");
       }
     }
   }
   add(new OpenIdRegistrationInformationDisplayForm("form", registrationModel));
 }