return directResponse(httpResp, response.keyValueFormEncoding());
else
{
if (authReq.hasExtension(AxMessage.OPENID_NS_AX))
{
MessageExtension ext = authReq.getExtension(AxMessage.OPENID_NS_AX);
if (ext instanceof FetchRequest)
{
FetchRequest fetchReq = (FetchRequest) ext;
Map required = fetchReq.getAttributes(true);
//Map optional = fetchReq.getAttributes(false);
if (required.containsKey("email"))
{
Map userDataExt = new HashMap();
//userDataExt.put("email", userData.get(3));
FetchResponse fetchResp =
FetchResponse.createFetchResponse(fetchReq, userDataExt);
// (alternatively) manually add attribute values
fetchResp.addAttribute("email",
"http://schema.openid.net/contact/email", email);
response.addExtension(fetchResp);
}
}
else //if (ext instanceof StoreRequest)
{
throw new UnsupportedOperationException("TODO");
}
}
if (authReq.hasExtension(SRegMessage.OPENID_NS_SREG))
{
MessageExtension ext = authReq.getExtension(SRegMessage.OPENID_NS_SREG);
if (ext instanceof SRegRequest)
{
SRegRequest sregReq = (SRegRequest) ext;
List required = sregReq.getAttributes(true);
//List optional = sregReq.getAttributes(false);