Hi João,

Luckily Restlet makes this sort of thing really easy. 

All you need to do is make the Guard (or ChallengeGuard in M2) handle and
forward the requests once you've authenticated the user. I.e something like:

 public Restlet createRoot() {

        Router securedRoute = new Router(getContext());

        securedRouter.add("/users", UsersResource.class);
        securedRouter.add("/user/{id}", UserResource.class);

        Guard guard = new Guard(getContext(), ChallengeScheme.HTTP_BASIC,
"whatever");
        guard.setNext(securedRoute);
        return guard;
  }

Hope that vaguely helps,
Matt


João Pereira wrote:
> 
> Hi, 
> 
> How to secure all the application instead of each route?
> 
> if this seems to be a newbie question it's because I'm a newbie :)
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1946647
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/securing-the-whole-application-tp2726872p2729929.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1957093

Reply via email to