Thank you But yet, I don't see how to use the SecurityContext in order to add Basic Authentification to my JAX-RS Application.
I followed the tutorial : http://wiki.restlet.org/docs_1.1/13-restlet/28-restlet/57-restlet.html But where could I use the SecurityContext? I really don't see. in the root resource? in the application? in the server? I am following the tutorial categories. This method is the best I found. http://www.restlet.org:8080/documentation/snapshot/jse/ext/org/restlet/ext/jaxrs/JaxRsApplication.html#setGuard(org.restlet.security.Authenticator) But it didn't work with 2.0.1 (first email of this thread) but I didn't tried with 2.0.3. When I'll have some free time, I'll try with 2.0.3, and file a bug if it doesn't work. Thank you for your help. Restlet is a great software !!!! Cheers Romain 2010/10/9 Stephan Koops <[email protected]> > Hi Romain, > > I don't if I answered to this question: > > > Now it is working but I am wondering about the RoleChecker. My > RoleChecker is like this : > > > > @SuppressWarnings("deprecation") > > private static final class RestletRoleChecker implements RoleChecker > { > > > > public boolean isInRole(Principal principal, String role) { > > throw new RuntimeException("[isInRole] was called. We don't > know why this class is needed."); > > } > > } > It was the first design, it isn't needed anymore. I didn't remove it > yet. If it does nothing, it should be removed. > > and why : > > > > application.setGuard(guard); //not deprecated > > > > doesn't work instead. > This I can't tell you without have a look in it. Please file a bug. > > Because application.setAuthentication is deprecated, how can I use > ClientInfo.getRoles() instead ? > You should use the JAX-RS way with interface SecurityContext. > > best regards > Stephan > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2669650 > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2690950

