I am using Java jersey Restful webservice.
How can I add authenication mechanism to this jersey webservice, Once its authenticated I need to ratain the session ?
Asked
Active
Viewed 2,060 times
1

SachinJose
- 8,462
- 4
- 42
- 63
1 Answers
2
You need to add a filter to your Jersey server that carries out authentication. Jersey provide one using Basic authentication as HttpBasicAuthFilter
, and there are lots of other examples out there on the 'net using different authentication schemes.
You should not use sessions with REST, as it creates a link between multiple requests over time; every REST request should be standalone and not rely on anything that has happened previously. Each REST request should have its own authentication parameters.