Closed GoogleCodeExporter closed 9 years ago
the code copy from consumerSample:
ConsumerManager manager=(ConsumerManager) pageContext.getAttribute("consumermanager", PageContext.APPLICATION_SCOPE);
try
{
// --- processing the authentication response
// extract the parameters from the authentication response
// (which comes in as a HTTP request from the OpenID provider)
ParameterList responselist =
new ParameterList(request.getParameterMap());
// retrieve the previously stored discovery information
DiscoveryInformation discovered =
(DiscoveryInformation) session.getAttribute("openid-disco");
// extract the receiving URL from the HTTP request
StringBuffer receivingURL = request.getRequestURL();
String queryString = request.getQueryString();
if (queryString != null && queryString.length() > 0)
receivingURL.append("?").append(request.getQueryString());
// verify the response; ConsumerManager needs to be the same
// (static) instance used to place the authentication request
VerificationResult verification = manager.verify(
receivingURL.toString(),
responselist, discovered);
// examine the verification result and extract the verified identifier
Identifier verified = verification.getVerifiedId();
if (verified != null)
{
AuthSuccess authSuccess =
(AuthSuccess) verification.getAuthResponse();
session.setAttribute("openid", authSuccess.getIdentity());
session.setAttribute("openid-claimed", authSuccess.getClaimed());
response.sendRedirect("."); // success
}
else
{
%>
Failed to login!
<%
}
}
catch (OpenIDException e)
{
// present error to the user
out.println("login error:"+e.getMessage());
}
Original comment by am_h_2...@hotmail.com
on 13 Dec 2010 at 7:15
RP cannot reach the OP for discovery info verification.
Original comment by Johnny.B...@gmail.com
on 31 Oct 2012 at 11:00
Original issue reported on code.google.com by
am_h_2...@hotmail.com
on 13 Dec 2010 at 7:09