Does anyone have a sample application about what is described on this answer?
有没有人有关于这个答案描述内容的示例应用程序?
User authentication on a Jersey REST service
Jersey REST服务上的用户身份验证
1 个解决方案
#1
9
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.
步骤1.在您的球衣应用程序中插入过滤器(请参阅Jersey DOCS如何拦截请求)。
步骤2.要求客户端应用程序在Header中传递用户凭据,以便您在Jersey Service Filter中获取它们。
步骤3.获取标头值并要求您的数据库验证它们。
步骤4.一旦验证,使用安全上下文来存储原则(用户)。
步骤5.使用存储的安全上下文来验证您的Jersey服务子资源。
Follow my steps and you will achieve your answer.
按照我的步骤,你会得到你的答案。
#1
9
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.
步骤1.在您的球衣应用程序中插入过滤器(请参阅Jersey DOCS如何拦截请求)。
步骤2.要求客户端应用程序在Header中传递用户凭据,以便您在Jersey Service Filter中获取它们。
步骤3.获取标头值并要求您的数据库验证它们。
步骤4.一旦验证,使用安全上下文来存储原则(用户)。
步骤5.使用存储的安全上下文来验证您的Jersey服务子资源。
Follow my steps and you will achieve your answer.
按照我的步骤,你会得到你的答案。