public static AssociationRequest createAssociationRequest( AssociationSessionType type) throws MessageException { return createAssociationRequest(type, null); }
public static AssociationRequest createAssociationRequest( ParameterList params) throws MessageException { AssociationRequest req = new AssociationRequest(params); req.validate(); if (DEBUG) _log.debug("Created association request from message parameters:\n" + req.keyValueFormEncoding()); return req; }
/** * Gets the association / session type of the association request. * * @throws AssociationException */ public AssociationSessionType getType() throws AssociationException { return AssociationSessionType.create( getSessionType(), getAssociationType(), ! isVersion2() ); }
/** * Gets the Diffie-Hellman modulus parameter of the message, or null for * messages with no-encryption sessions. */ public String getDhModulus() { String modulus = getParameterValue("openid.dh_modulus"); return modulus != null ? modulus : hasParameter("openid.dh_consumer_public") ? DiffieHellmanSession.DEFAULT_MODULUS_BASE64 : null; }
try { type = getType(); if (type.isVersion2() != isVersion2()) { throw new MessageException("Protocol verison mismatch " + "between association session type: " + type + if (!isVersion2() && getSessionType() == null) { throw new MessageException( "sess_type cannot be omitted in OpenID1 association requests", if (type.getHAlgorithm() != null && getDhPublicKey() == null) { throw new MessageException("DH consumer public key not specified.", OpenIDException.ASSOC_ERROR); if (type.getHAlgorithm() == null && (getDhGen() != null || getDhModulus() != null || getDhPublicKey() != null)) { throw new MessageException( "No-encryption session, but DH parameters specified.",
public static AssociationRequest createAssociationRequest( AssociationSessionType type, DiffieHellmanSession dhSess) throws MessageException { AssociationRequest req = new AssociationRequest(type, dhSess); // make sure the association / session type matches the dhSess if ( type == null || (dhSess == null && type.getHAlgorithm() != null) || (dhSess != null && ! dhSess.getType().equals(type) ) ) throw new MessageException( "Invalid association / session combination specified: " + type + "DH session: " + dhSess); req.validate(); if (DEBUG) _log.debug("Created association request:\n" + req.keyValueFormEncoding()); return req; } public static AssociationRequest createAssociationRequest(
AssociationRequest.createAssociationRequest(requestParams); isVersion2 = assocReq.isVersion2(); AssociationSessionType type = assocReq.getType(); AssociationRequest.createAssociationRequest( AssociationSessionType.NO_ENCRYPTION_COMPAT_SHA1MAC);
_log.debug("Trying association type: " + assocReq.getType()); if (alreadyTried.keySet().contains(assocReq.getType())) alreadyTried.put(assocReq.getType(), null); assocResp.getAssociation(assocReq.getDHSess()); handle = assoc.getHandle(); if ( respType.equals(assocReq.getType()) || newReq.getType());
/** * Gets the Relying Party's (consumer) Diffie-Hellman public key, or null * for messages with no-encryption sessions. */ public String getDhPublicKey() { return getParameterValue("openid.dh_consumer_public"); }
private IncomingRequest doAssociation(HttpServletRequest request, HttpServletResponse response, ServerManager serverManager, ParameterList parameterList) throws IOException, MessageException, AssociationException { /* * If not running over SSL, only allow DH */ if (!request.isSecure()) { AssociationRequest associationRequest = AssociationRequest .createAssociationRequest(parameterList); AssociationSessionType associationSessionType = associationRequest .getType(); if (associationSessionType.getHAlgorithm() == null) { throw new AssociationException("Not running over " + "SSL requires DH."); } } LOG.debug("associate"); Message message = serverManager.associationResponse(parameterList); String keyValueFormEncoding = message.keyValueFormEncoding(); LOG.debug("form encoding: " + keyValueFormEncoding); PrintWriter printWriter = response.getWriter(); printWriter.print(keyValueFormEncoding); return null; }
type = getType(); if (type.isVersion2() != isVersion2()) if (! isVersion2() && getSessionType() == null) if ( type.getHAlgorithm() != null && getDhPublicKey() == null) if (type.getHAlgorithm() == null && (getDhGen() != null || getDhModulus() != null || getDhPublicKey() != null) )
public static AssociationRequest createAssociationRequest( AssociationSessionType type, DiffieHellmanSession dhSess) throws MessageException { AssociationRequest req = new AssociationRequest(type, dhSess); // make sure the association / session type matches the dhSess if ( type == null || (dhSess == null && type.getHAlgorithm() != null) || (dhSess != null && ! dhSess.getType().equals(type) ) ) throw new MessageException( "Invalid association / session combination specified: " + type + "DH session: " + dhSess); req.validate(); if (DEBUG) _log.debug("Created association request:\n" + req.keyValueFormEncoding()); return req; } public static AssociationRequest createAssociationRequest(
AssociationRequest.createAssociationRequest(requestParams); isVersion2 = assocReq.isVersion2(); AssociationSessionType type = assocReq.getType(); AssociationRequest.createAssociationRequest( AssociationSessionType.NO_ENCRYPTION_COMPAT_SHA1MAC);
/** * Gets the Diffie-Hellman generator parameter of the message, or null for * messages with no-encryption sessions. */ public String getDhGen() { String gen = getParameterValue("openid.dh_gen"); return gen != null ? gen : hasParameter("openid.dh_consumer_public") ? DiffieHellmanSession.DEFAULT_GENERATOR_BASE64 : null; }
_log.debug("Trying association type: " + assocReq.getType()); if (alreadyTried.keySet().contains(assocReq.getType())) alreadyTried.put(assocReq.getType(), null); assocResp.getAssociation(assocReq.getDHSess()); handle = assoc.getHandle(); if ( respType.equals(assocReq.getType()) || newReq.getType());
/** * Gets the Relying Party's (consumer) Diffie-Hellman public key, or null * for messages with no-encryption sessions. */ public String getDhPublicKey() { return getParameterValue("openid.dh_consumer_public"); }
type = getType(); if (type.isVersion2() != isVersion2()) if (! isVersion2() && getSessionType() == null) if ( type.getHAlgorithm() != null && getDhPublicKey() == null) if (type.getHAlgorithm() == null && (getDhGen() != null || getDhModulus() != null || getDhPublicKey() != null) )
public static AssociationRequest createAssociationRequest( AssociationSessionType type, DiffieHellmanSession dhSess) throws MessageException { AssociationRequest req = new AssociationRequest(type, dhSess); // make sure the association / session type matches the dhSess if ( type == null || (dhSess == null && type.getHAlgorithm() != null) || (dhSess != null && ! dhSess.getType().equals(type) ) ) throw new MessageException( "Invalid association / session combination specified: " + type + "DH session: " + dhSess); req.validate(); if (DEBUG) _log.debug("Created association request:\n" + req.keyValueFormEncoding()); return req; } public static AssociationRequest createAssociationRequest(
AssociationRequest.createAssociationRequest(requestParams); isVersion2 = assocReq.isVersion2(); AssociationSessionType type = assocReq.getType(); AssociationRequest.createAssociationRequest( AssociationSessionType.NO_ENCRYPTION_COMPAT_SHA1MAC);
/** * Gets the Diffie-Hellman modulus parameter of the message, or null for * messages with no-encryption sessions. */ public String getDhModulus() { String modulus = getParameterValue("openid.dh_modulus"); return modulus != null ? modulus : hasParameter("openid.dh_consumer_public") ? DiffieHellmanSession.DEFAULT_MODULUS_BASE64 : null; }