Context context = new Context(_server, "/", Context.SESSIONS);
_baseUrl = "http://localhost:" + servletPort; // +
// context.getContextPath();
SampleConsumer consumer = new SampleConsumer(_baseUrl + "/loginCallback");
context.addServlet(new ServletHolder(new LoginServlet(consumer)), "/login");
context.addServlet(new ServletHolder(new LoginCallbackServlet(consumer)), "/loginCallback");
context.addServlet(new ServletHolder(new UserInfoServlet()), "/user");
SampleServer server = new SampleServer(_baseUrl + "/provider")
{
protected List userInteraction(ParameterList request) throws ServerException
{
List back = new ArrayList();
back.add("userSelectedClaimedId"); // userSelectedClaimedId
back.add(Boolean.TRUE); // authenticatedAndApproved
back.add("user@example.com"); // email
return back;
}
};
context.addServlet(new ServletHolder(new ProviderServlet(server)), "/provider");
}