c#客户端与cxf的安全验证问题

View: New views
7 Messages — Rating Filter:   Alert me  

c#客户端与cxf的安全验证问题

by virons :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

目前有个项目需要采用.net Winform访问cxf的webservice,两端交互没有问题,但是webservice是暴露在
Internet中,没有安全验证,google后也没有发现好的解决方案,请各位大虾指教,谢谢!
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: c#客户端与cxf的安全验证问题

by Freeman Fang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

你可以考虑使用https transport,或者用http basic auth来做验证
Freeman
On 2009-8-5, at 下午5:32, virons wrote:

目前有个项目需要采用.net Winform访问cxf的webservice,两端交互没有问题,但是webservice是暴露在
Internet中,没有安全验证,google后也没有发现好的解决方案,请各位大虾指教,谢谢!




-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: c#客户端与cxf的安全验证问题

by virons :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

感谢Freeman Fang如此快的回复,我继续研究中,可否再具体一些?
client是WM6,是Winform,而Server采用java;我看过了cxf的samples的例子,client都是采用java调用
service,容易处理;但采用.net的资料较少


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: c#客户端与cxf的安全验证问题

by Freeman Fang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

我对.net 不是很熟悉,但是我相信.net的client一定是能够支持https 或者是http basic auth的,简单的google了一些,这个帖子[1]对你也许有用

Freeman
On 2009-8-5, at 下午6:00, virons wrote:

感谢Freeman Fang如此快的回复,我继续研究中,可否再具体一些?
client是WM6,是Winform,而Server采用java;我看过了cxf的samples的例子,client都是采用java调用
service,容易处理;但采用.net的资料较少






-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: c#客户端与cxf的安全验证问题

by virons :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi
  最近找了很多资料,难以解决cxf与.net端的安全问题,最后采用在soap header加入自定义信息在两端进行验证。
 但现在遇到一个问题:cxf我定义了一个拦截器,
public class AuthSoapHeaderInterceptor extends AbstractSoapInterceptor
{

        public AuthSoapHeaderInterceptor() {
                super(Phase.PRE_PROTOCOL);
                addAfter(LoggingInInterceptor.class.getName());
        }

        public void handleMessage(SoapMessage message) throws Fault {
                     ...........
                    if(认证失败){
                       throw new SecurityException("认证失败!");
                       ...........
                    }
                    ...........
                }


cxf配置如下:
                <jaxws:inInterceptors>
                        <bean class=".......LoggingInInterceptor" />
                        <bean class=".........security.AuthSoapHeaderInterceptor" />
                </jaxws:inInterceptors>

虽然cxf端可以验证,并抛出了异常,但客户端还是能够取得数据,并没有达到目的,
请问如何在抛出异常后而终止后续程序,并返回异常给客户端?
谢谢!
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: c#客户端与cxf的安全验证问题

by Freeman Fang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

你的server是cxf, client是.net?
如果你的AuthSoapHeaderInterceptor抛出异常,就应该会终止,客户端不应该能取的进一步的数据
不知道你的AuthSoapHeaderInterceptor中的具体代码是什么?你是不是又把hrow new SecurityException catch住了?
还有你可以试试
if(认证失败){
                      throw new Fault(new SecurityException("认证失败!"));
                   
                   }
Freeman

On 2009-8-13, at 上午11:57, virons wrote:

Hi
 最近找了很多资料,难以解决cxf与.net端的安全问题,最后采用在soap header加入自定义信息在两端进行验证。
但现在遇到一个问题:cxf我定义了一个拦截器,
public class AuthSoapHeaderInterceptor extends AbstractSoapInterceptor
{

public AuthSoapHeaderInterceptor() {
super(Phase.PRE_PROTOCOL);
addAfter(LoggingInInterceptor.class.getName());
}

public void handleMessage(SoapMessage message) throws Fault {
                    ...........
                   if(认证失败){
                      throw new SecurityException("认证失败!");
                      ...........
                   }
                   ...........
               }


cxf配置如下:
<jaxws:inInterceptors>
<bean class=".......LoggingInInterceptor" />
<bean class=".........security.AuthSoapHeaderInterceptor" />
</jaxws:inInterceptors>

虽然cxf端可以验证,并抛出了异常,但客户端还是能够取得数据,并没有达到目的,
请问如何在抛出异常后而终止后续程序,并返回异常给客户端?
谢谢!




-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: c#客户端与cxf的安全验证问题

by virons :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thanks a lot!

On 8月13日, 下午12时49分, Freeman Fang <freeman.f...@...> wrote:

> Hi,
>
> 你的server是cxf, client是.net?
> 如果你的AuthSoapHeaderInterceptor抛出异常,就应该会终止,客户端不应该能
> 取的进一步的数据
> 不知道你的AuthSoapHeaderInterceptor中的具体代码是什么?你是不是又把hrow  
> new SecurityException catch住了?
> 还有你可以试试
>
> > if(认证失败){
> >                       throw new Fault(new SecurityException("认证失
> > 败!"));
>
> >                    }
>
> Freeman
>
> On 2009-8-13, at 上午11:57, virons wrote:
>
>
>
>
>
> > Hi
> >  最近找了很多资料,难以解决cxf与.net端的安全问题,最后采用在soap  
> > header加入自定义信息在两端进行验证。
> > 但现在遇到一个问题:cxf我定义了一个拦截器,
> > public class AuthSoapHeaderInterceptor extends AbstractSoapInterceptor
> > {
>
> >    public AuthSoapHeaderInterceptor() {
> >            super(Phase.PRE_PROTOCOL);
> >            addAfter(LoggingInInterceptor.class.getName());
> >    }
>
> >    public void handleMessage(SoapMessage message) throws Fault {
> >                     ...........
> >                    if(认证失败){
> >                       throw new SecurityException("认证失败!");
> >                       ...........
> >                    }
> >                    ...........
> >                }
>
> > cxf配置如下:
> >            <jaxws:inInterceptors>
> >                    <bean class=".......LoggingInInterceptor" />
> >                    <bean class=".........security.AuthSoapHeaderInterceptor" />
> >            </jaxws:inInterceptors>
>
> > 虽然cxf端可以验证,并抛出了异常,但客户端还是能够取得数据,并没有达到
> > 目的,
> > 请问如何在抛出异常后而终止后续程序,并返回异常给客户端?
> > 谢谢!
>
> --
> Freeman Fang
> ------------------------
> Open Source SOA:http://fusesource.com- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---