empty AuthenticationResponse from myOpenID.com

3 views
Skip to first unread message

CamelBrother

unread,
Jun 3, 2008, 8:04:40 AM6/3/08
to joid-dev
Hi,

Can anyone please tell me why the last line of the code section below
raises an exception ?
[ debugging the source code of the library helped me find out that it
gets an empty response from the call
HttpURLConnection connection = (HttpURLConnection)
url.openConnection(); ]
===============================================================================
String openIDIdentifier = request.getParameter("OpenIDIdentifier");
String returnTo = UrlUtils.getBaseUrl(request);
String trustRoot = UrlUtils.getHostUrl(request);
/* create a diffie hellman's shared secret */
DiffieHellman dh = DiffieHellman.getDefault();
Crypto crypto = new Crypto();
crypto.setDiffieHellman(dh);
/* create an association request to be sent to OP */
AssociationRequest asrq = AssociationRequest.create(crypto);
/* create a discoverer to reveal the OP */
Discoverer discoverer = new Discoverer();
ServerAndDelegate serverAndDelegate =
discoverer.findIdServer(openIDIdentifier);
String OP = serverAndDelegate.getServer();
/* send association request to OP, and receive a response from it */
AssociationResponse asrp = (AssociationResponse) Util.send(asrq, OP);
/* save important properties */
String handle = asrp.getAssociationHandle();
BigInteger serverPublic = asrp.getDhServerPublic();
byte[] encryptedKey = asrp.getEncryptedMacKey();
BigInteger privateKey = dh.getPrivateKey();
BigInteger modulus = DiffieHellman.DEFAULT_MODULUS;
AuthenticationRequest aurq =
AuthenticationRequest.create(openIDIdentifier, returnTo, trustRoot,
handle);
AuthenticationResponse aurp = (AuthenticationResponse) Util.send(aurq,
OP);
===============================================================================

Thanks in advance.
Reply all
Reply to author
Forward
0 new messages