log.info("Found - " + di.getOPEndpoint());
target = di.getOPEndpoint().toString();
}
}
ConsumerManager manager = getManager(target);
// try {
// discoveries = manager.discover(target);
// } catch (YadisException e) {
// log.info("Could not connect in time!!!!!!!!!!!!!!!!!!!!!!");
// return new
// StringRepresentation("Could not connect to Identity Server in time.",MediaType.TEXT_HTML);
// }
// attempt to associate with the OpenID provider
// and retrieve one service endpoint for authentication
DiscoveryInformation discovered = manager.associate(discoveries);
// store the discovery information in the user's session
// getContext().getAttributes().put("openid-disc", discovered);
String sessionId = String.valueOf(System
.identityHashCode(discovered));
session.put(sessionId, discovered);
getResponse().getCookieSettings().add(
new CookieSetting(DESCRIPTOR_COOKIE, sessionId));
log.info("Setting DESCRIPTOR COOKIE");
// obtain a AuthRequest message to be sent to the OpenID provider
AuthRequest authReq = manager.authenticate(discovered,
returnToUrl.toString()); // TODO maybe add TIMESTAMP?
// Domain wide realm add meta to main page
// http://localhost:8080/oauth/xrds?returnTo=http://localhost:8080/oauth/openid_login\r\n
// log.info("OpenID - REALM = " +
// getReference().getHostIdentifier());