I'm trying to use the new ChallengeGuard but must be missing something. The
following code skips the guard and goes directly to the resource for
http://localhost/user/1234:
@Override
public synchronized Restlet createRoot() {
Router router = new Router(getContext());
// protected resources
// -- user
Router userResources = new Router(getContext());
userResources.attach("/{id}", UserResource.class);
ChallengeGuard userGuard = new ChallengeGuard(getContext(),
ChallengeScheme.HTTP_DIGEST, new ResourceAuthorizer());
userGuard.getAuthenticator().setVerifier(new AuthVerifier());
userGuard.setNext(userResources);
router.attach("/user", userGuard);
// static files
File pwd = new File(".");
Directory dir = new Directory(getContext(),
"file:///"+pwd.getAbsolutePath()+"/"+STATIC_FILE_DIR);
router.attach("/", dir);
return router;
}
Thanks in advance.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1059214