You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Nagamohan <na...@gmail.com> on 2012/02/16 10:55:24 UTC

Apache cxf 2.4.2 Custom UserNameToken validator

Hi,

We are trying to use WS-Security with UserNameToken with cxf 2.4.2. We have
a custom CallbackHandler where it doesn't have a mechanism to set the
original password to be compared with the one got from SOAP request, but for
the given username and password  we know how to authenticate.

How can we get away this problem, is there any way to write custom
validators for WS-Security UsernameToken validation?

Thanks,
-Nagamohan

--
View this message in context: http://cxf.547215.n5.nabble.com/Apache-cxf-2-4-2-Custom-UserNameToken-validator-tp5489035p5489035.html
Sent from the cxf-user mailing list archive at Nabble.com.

AW: Apache cxf 2.4.2 Custom UserNameToken validator

Posted by Oliver Wulff <ow...@talend.com>.
Hi there

Colm's blog describes on his blog how to configure a custom token validator in CXF 2.4 and WSS4J:

http://coheigea.blogspot.com/2011/06/custom-token-validation-in-apache-cxf.html

HTH

------

Oliver Wulff

http://owulff.blogspot.com
Solution Architect
Talend Application Integration Division http://www.talend.com

________________________________________
Von: Nagamohan [nagamohan.koganti@gmail.com]
Gesendet: Donnerstag, 16. Februar 2012 10:55
Bis: users@cxf.apache.org
Betreff: Apache cxf  2.4.2 Custom UserNameToken validator

Hi,

We are trying to use WS-Security with UserNameToken with cxf 2.4.2. We have
a custom CallbackHandler where it doesn't have a mechanism to set the
original password to be compared with the one got from SOAP request, but for
the given username and password  we know how to authenticate.

How can we get away this problem, is there any way to write custom
validators for WS-Security UsernameToken validation?

Thanks,
-Nagamohan

--
View this message in context: http://cxf.547215.n5.nabble.com/Apache-cxf-2-4-2-Custom-UserNameToken-validator-tp5489035p5489035.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Apache cxf 2.4.2 Custom UserNameToken validator

Posted by Nagamohan <na...@gmail.com>.
Thanks Colm and Sergey for you responses,

I am able to register Custom validator for UsernameToken. It's a mistake
from my side and with the above code fragment way it is working.

Thanks,
-Nagamohan

--
View this message in context: http://cxf.547215.n5.nabble.com/Apache-cxf-2-4-2-Custom-UserNameToken-validator-tp5489035p5491898.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Apache cxf 2.4.2 Custom UserNameToken validator

Posted by Sergey Beryozkin <sb...@gmail.com>.
It appears the properties are not set right,

serviceProperties.put("ws-security.validate.token", "false");

moves the chain to a different path, so for using a CustomValidator the 
above property will need to be dropped

Sergey

On 16/02/12 14:48, Colm O hEigeartaigh wrote:
> Are you still getting the error with a more up-to-date version of CXF
> 2.4? If so, could you create a test-case that shows the problem and
> attach it to a new JIRA?
>
> Colm.
>
> On Thu, Feb 16, 2012 at 1:08 PM, Nagamohan<na...@gmail.com>  wrote:
>> Hi Colm,
>>
>> Thanks for your response
>>
>> I have written a custom validator and registering it programatically with
>> following code
>>
>> Map<String, Object>  serviceProperties = new HashMap<String, Object>();
>> serviceProperties.put("ws-security.validate.token", "false");
>> serviceProperties.put("ws-security.ut.no-callbacks", "true");
>> serviceProperties.put("ws-security.ut.validator",
>> CustomUTValidator.class.getName());
>> endPoint.setProperties(serviceProperties);
>>
>> With this it is still invoking UserNameTokenValidator instead of my custom
>> one.
>>
>> Am i doing it in the right way?
>>
>> Thanks,
>> -Nagamohan
>>
>> --
>> View this message in context: http://cxf.547215.n5.nabble.com/Apache-cxf-2-4-2-Custom-UserNameToken-validator-tp5489035p5489464.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Apache cxf 2.4.2 Custom UserNameToken validator

Posted by Colm O hEigeartaigh <co...@apache.org>.
Are you still getting the error with a more up-to-date version of CXF
2.4? If so, could you create a test-case that shows the problem and
attach it to a new JIRA?

Colm.

On Thu, Feb 16, 2012 at 1:08 PM, Nagamohan <na...@gmail.com> wrote:
> Hi Colm,
>
> Thanks for your response
>
> I have written a custom validator and registering it programatically with
> following code
>
> Map<String, Object> serviceProperties = new HashMap<String, Object>();
> serviceProperties.put("ws-security.validate.token", "false");
> serviceProperties.put("ws-security.ut.no-callbacks", "true");
> serviceProperties.put("ws-security.ut.validator",
> CustomUTValidator.class.getName());
> endPoint.setProperties(serviceProperties);
>
> With this it is still invoking UserNameTokenValidator instead of my custom
> one.
>
> Am i doing it in the right way?
>
> Thanks,
> -Nagamohan
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Apache-cxf-2-4-2-Custom-UserNameToken-validator-tp5489035p5489464.html
> Sent from the cxf-user mailing list archive at Nabble.com.



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: Apache cxf 2.4.2 Custom UserNameToken validator

Posted by Nagamohan <na...@gmail.com>.
Hi Colm,

Thanks for your response

I have written a custom validator and registering it programatically with
following code

Map<String, Object> serviceProperties = new HashMap<String, Object>();
serviceProperties.put("ws-security.validate.token", "false");
serviceProperties.put("ws-security.ut.no-callbacks", "true");
serviceProperties.put("ws-security.ut.validator",
CustomUTValidator.class.getName());
endPoint.setProperties(serviceProperties);

With this it is still invoking UserNameTokenValidator instead of my custom
one.

Am i doing it in the right way?

Thanks,
-Nagamohan

--
View this message in context: http://cxf.547215.n5.nabble.com/Apache-cxf-2-4-2-Custom-UserNameToken-validator-tp5489035p5489464.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Apache cxf 2.4.2 Custom UserNameToken validator

Posted by Colm O hEigeartaigh <co...@apache.org>.
See here for some information on validating a UsernameToken when you
don't have the password in the CallbackHandler:

http://coheigea.blogspot.com/2011/06/custom-token-validation-in-apache-cxf.html

Colm.

On Thu, Feb 16, 2012 at 9:55 AM, Nagamohan <na...@gmail.com> wrote:
> Hi,
>
> We are trying to use WS-Security with UserNameToken with cxf 2.4.2. We have
> a custom CallbackHandler where it doesn't have a mechanism to set the
> original password to be compared with the one got from SOAP request, but for
> the given username and password  we know how to authenticate.
>
> How can we get away this problem, is there any way to write custom
> validators for WS-Security UsernameToken validation?
>
> Thanks,
> -Nagamohan
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Apache-cxf-2-4-2-Custom-UserNameToken-validator-tp5489035p5489035.html
> Sent from the cxf-user mailing list archive at Nabble.com.



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com