I have an application which uses restlet 2.2 and JAX-RS extension which can provide authentication. However I couldn't add authorization to it. This is my code which is in a class that extended from javax.ws.rs.core.Application:
ChallengeAuthenticator challengeGuard = new ChallengeAuthenticator(null, ChallengeScheme.HTTP_BASIC, "REST API Realm");
//Create in-memory users with roles
MemoryRealm realm = new MemoryRealm();
User user = new User("user", "user");
realm.map(user, Role.get(null, ""));
User owner = new User("admin2", "nutch");
realm.map(owner, Role.get(null, "admin"));
//Attach verifier to check authentication and enroler to determine roles
My resource classes are annotiated with @Path annotation as well. How can I add role based authentication into it?
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].