开发者

Jersey JAX-RS + Spring security application sample

开发者 https://www.devze.com 2023-03-22 13:41 出处:网络
Does anyone have a sample application about what is described on this answer? User authentication on a Je开发者_运维百科rsey REST serviceUse Followings Steps:

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

User authentication on a Je开发者_运维百科rsey REST service


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消