繁体   English   中英

保护Apache CXF REST和SOAP服务以及检索代码中的权限

[英]Securing apache CXF REST and SOAP services and retrieving authorities in code

我已经按照这里的文章http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-revisited/

我现在有一个工作拦截器用于我的肥皂服务,不会在没有用户名和密码的情况下使用服务。

我有几个问题:

  1. 如何在业务逻辑的不同包中访问授权对象以找出登录的用户及其角色?

  2. 如何将相同的系统连接到休息服务,是否可能或者我需要将其分离出来?

Cheeers,Rob

从服务中,您可以执行以下操作:

PhaseInterceptorChain.getCurrentMessage().get(AuthorizationPolicy.class);

获取AuthorizationPolicy并将其用于您需要的任何操作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM