String rc = params.getFirstValue("return");
if (rc != null && rc.length() > 0) {
Map<String, String> axRequired = new HashMap<String, String>();
Map<String, String> axOptional = new HashMap<String, String>();
Identifier i = verifyResponse(axRequired, axOptional);
if (i == null) {
log.info("Authentication Failed");
getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND);
return new StringRepresentation("Authentication Failed");
}
log.info("Identifier = " + i.getIdentifier());
String id = i.getIdentifier();
if (id != null) {
// New Code, always return JSON and let filter handle any
// callback.
// TODO maybe move it to use Principal.
JSONObject obj = new JSONObject();
try {
obj.put("id", i.getIdentifier());
for (String s : axRequired.keySet()) {
obj.put(s, axRequired.get(s));
}
for (String s : axOptional.keySet()) {
obj.put(s, axOptional.get(s));