Examples of PapeRequest


Examples of org.openid4java.message.pape.PapeRequest

   * @throws RelyingPartyException
   */
  public MessageExtension getMessageExtension(OpenIDAuthenticationRequest request)
      throws IdentityException {

    PapeRequest papeReq = null;

    papeReq = PapeRequest.createPapeRequest();

    for (AuthPolicyType authType : request.getAuthTypes()) {
      switch (authType) {
        case PAPE_POLICY_MULTI_FACTOR :
          papeReq.addPreferredAuthPolicy(PapeMessage.PAPE_POLICY_MULTI_FACTOR);
          break;
        case PAPE_POLICY_MULTI_FACTOR_PHYSICAL :
          papeReq.addPreferredAuthPolicy(PapeMessage.PAPE_POLICY_MULTI_FACTOR_PHYSICAL);
          break;
        case PAPE_POLICY_PHISHING_RESISTANT :
          papeReq.addPreferredAuthPolicy(PapeMessage.PAPE_POLICY_PHISHING_RESISTANT);
          break;
        default :
          break;
      }
    }
View Full Code Here

Examples of org.openid4java.message.pape.PapeRequest

      authReq.setRealm(realm);

      // add PAPE, if requested
      if (YES_STRING.equals(req.getParameter("reauth"))) {
        log.debug("Requesting PAPE reauth");
        PapeRequest pape = PapeRequest.createPapeRequest();
        pape.setMaxAuthAge(1);
        authReq.addExtension(pape);
      }

      session.setAttribute("discovered", helper.getDiscoveryInformation());
    } catch (DiscoveryException e) {
View Full Code Here

Examples of org.openid4java.message.pape.PapeRequest

   * @throws Exception
   */
  public static String[] getAuthenticationPolicies(AuthRequest authRequest) throws Exception {

    MessageExtension message = null;
    PapeRequest papeRequest = null;
    List preferredPolicies = null;

    try {
      if (authRequest.hasExtension(PapeMessage.OPENID_NS_PAPE)) {
        message = authRequest.getExtension(PapeMessage.OPENID_NS_PAPE);

                if (message instanceof PapeRequest) {
                    papeRequest = (PapeRequest) message;
                    preferredPolicies = papeRequest.getPreferredAuthPoliciesList();
                    if (preferredPolicies != null && !preferredPolicies.isEmpty())
                        return (String[]) preferredPolicies.toArray(new String[preferredPolicies
                                .size()]);
                }
            }
View Full Code Here

Examples of org.openid4java.message.pape.PapeRequest

        fetch.addAttribute("Email", SCHEMA_EMAIL, true);
        aReq.addExtension(fetch);
      }

      if (0 <= papeMaxAuthAge) {
        final PapeRequest pape = PapeRequest.createPapeRequest();
        pape.setMaxAuthAge(papeMaxAuthAge);
        aReq.addExtension(pape);
      }
    } catch (MessageException e) {
      log.error("Cannot create OpenID redirect for " + openidIdentifier, e);
      cb.onSuccess(new DiscoveryResult(DiscoveryResult.Status.ERROR));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.