Jersey JAX-RS + Spring security application sample

别等时光非礼了梦想. 提交于 2019-11-27 16:38:11

问题


Does anyone have a sample application about what is described on this answer?

User authentication on a Jersey REST service


回答1:


Use Followings Steps:

  • Step 1. Insert a Filter(See Jersey DOCS how to intercept request) in your jersey Application.
  • Step 2. Ask client application to pass user credentials in Header, So that you fetch them in Jersey Service Filter.
  • Step 3. Fetch the header values and ask your DB to validate them.
  • Step 4. Once validated use Security Context to store the principle(User).
  • Step 5. Use stored Security Context to validate your Jersey Service sub-resource.

Follow my steps and you will achieve your answer.



来源:https://stackoverflow.com/questions/6795568/jersey-jax-rs-spring-security-application-sample

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!