Jersey JAX-RS + Spring security application sample(Jersey JAX-RS + Spring 安全应用示例)
本文介绍了Jersey JAX-RS + Spring 安全应用示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人有关于这个答案中描述的示例应用程序吗?
Does anyone have a sample application about what is described on this answer?
Jersey REST 服务上的用户身份验证
推荐答案
使用如下步骤:
- 第 1 步.在您的球衣应用程序中插入一个过滤器(请参阅 Jersey DOCS 如何拦截请求).
- 第 2 步.要求客户端应用程序在 Header 中传递用户凭据,以便您在 Jersey 服务过滤器中获取它们.
- 第 3 步.获取标头值并要求您的数据库验证它们.
- 第 4 步.一旦验证使用安全上下文来存储原则(用户).
- 第 5 步.使用存储的安全上下文来验证您的 Jersey 服务子资源.
- 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.
这篇关于Jersey JAX-RS + Spring 安全应用示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
织梦狗教程
本文标题为:Jersey JAX-RS + Spring 安全应用示例
基础教程推荐
猜你喜欢
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- Struts2 URL 无法访问 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
