Hello Sam,

I think this is due to the default routing mode. It has been changed 
from "starts with" to "equals".
When the router checks the URI "/admin/hello", it compares this value to 
its registered routes : "/admin" and "/page/{pageName}".
According to the default matching mode, nor "/admin" and 
"/page/{pageName}" are equal to "/admin/hello".

Could you try to update this default mode on the root router as follow:
router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);

Best regards,
Thierry Boileau

> I can't seem to get ChallengeAuthenticators to work in Restlet GAE m6 when I 
> have both public and protected resources.
>
> I've created a custom class, MyAuthenticator, that extends 
> ChallengAuthenticator.  Right now it simply overrides the 
> authenticate(request, response) method and returns true.
>
> Below is my createInboundRoot method.  Anyone spot an obvious mistake:
>
> ------------------------------
>       @Override
>       public synchronized Restlet createInboundRoot() {
>               Router router = new Router(getContext());
>
>               //public resources
>               router.attach("/page/{pageName}", FreemarkerPageResource.class);
>               
>               // create a secure router and associate it with my custom 
> authenticator
>               Router secureRouter = new Router(getContext());
>               secureRouter.attach("/hello", HelloWorldResource.class);
>               
>               MyAuthenticator authenticator = new 
> MyAuthenticator(getContext(),
>                               ChallengeScheme.CUSTOM, "System Authentication 
> - Provide your credentials");
>               authenticator.setNext(secureRouter);
>               router.attach("/admin", authenticator);
>               
>               return router;
>       }
> ------------------------------
>
> When I hit the http://localhost:8080/admin url, the 
> MyAuthenticator.authenticate(request, response) method does get called.  But 
> if I try to hit http://localhost:8080/admin/hello I get a 404.
>
> Thanks,
> Sam
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2432717
>
>

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

Reply via email to