Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easy way for Authentication and Authorization with JAX-RS Jersey

I'm pretty new to REST and am currently developing an API with JAX-RS Jersey. I am curious on what is the easiest way to implement a user Management. I.e. users must log in and have restricted access to different resources depending on their role. From what I understand, using OAuth 2.0 is the current standard. Can I implement that with Jersey? Does anyone have a few links for me to get me started (examples, tutorials)? Or would you suggest another approach?

Thanks a lot

like image 293
jvataman Avatar asked Jul 30 '13 08:07

jvataman


People also ask

Which oauth1 Jersey modules support authorization flow and authentication?

jersey. security:oauth1-client : provides client OAuth 1 support for authorization flow and authentication. org.

Is Jax and Jersey RS the same?

JAX-RS is an specification (just a definition) and Jersey is a JAX-RS implementation. Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides its own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development.


1 Answers

There are multiple ways to achieve that, let me point few of them:

  1. HTTP Basic authentication (BA) implementation is the simplest technique for enforcing access controls to web resources because it doesn't require cookies, session identifier and login pages. Rather, HTTP Basic authentication uses static, standard HTTP headers which means that no handshakes have to be done in anticipation.

  2. Role based access control for J2EE applications using realm

  3. OAuth with REST:

like image 89
Juned Ahsan Avatar answered Oct 11 '22 01:10

Juned Ahsan