I have built some RESTful api's with REstlet 2.3.4. I've been using HTTP_BASIC which let the browser prompt for credentials but it's time for a proper login form. I figure the easiest way to implement this is CookieAuthenticator. I can't find full working examples on github/google. I am sure i'm over looking them can someone provide a working example implementing CookieAuthenticator in Restlet?
Asked
Active
Viewed 239 times
1 Answers
0
I did get this to work after all. I have a longer answer here with some code examples. First, i was missing the fact that CookieAuthenticator is a filter and HAS the logic to handle login and logout. You need to create EMPTY ServerResources with a method annotated with @Post that has nothing in the body. Second, extend CookieAuthenticator and overwrite isLoggingIn(..) and isLoggingOut(..) with the code found in the link.
Cheers, -ray

Ray Garcia
- 66
- 8
-
Hi Ray, to my mind, you should not have to create empty server resources. I wonder if there is a bug or something unclear. We'll keep you informed. – Thierry Boileau Sep 07 '15 at 06:32