Pregunta

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

¿Fue útil?

Solución

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:

Otros consejos

There's an OAuth 1.0 contrib for Jersey @ https://wikis.oracle.com/display/Jersey/OAuth Works great for me. OAuth 2 is not really a standard yet as it's not finished and there's still a lot of debate and interoperability issues around it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top