You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Massimiliano Masi <ma...@math.unifi.it> on 2007/11/01 19:44:43 UTC
[Axis2] (Long) Ws-Policy: problem with SAMLtoken and WSAS example
Hi All,
I'm very frustrated: I'm developing policies for getting a SAML 2 token
from a WS-Trust STS implemented using Rahas.
I've to put it in the wsse:Security. So I created the following policy
for the service that needs the token as is [1] (taken from the WSAS
example).
I got NPE:
19:20:49,721 ERROR [AxisServlet]
java.lang.NullPointerException
at
java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:103)
at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
at java.util.ResourceBundle.getString(ResourceBundle.java:285)
at org.apache.rahas.TrustException.getMessage(TrustException.java:105)
at org.apache.rahas.TrustException.<init>(TrustException.java:54)
at org.apache.rahas.TrustException.<init>(TrustException.java:83)
at
com.spirit.XUA.utils.SpiritTokenIssuer.issue(SpiritTokenIssuer.java:234)
org.apache.axis2.AxisFault: java.lang.NullPointerException
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
at
org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:127)
at
com.spirit.XUA.utils.XUAAssertions.getAuthenticatedViaWSTrust(XUAAssertions.java:430)
So, I cannot access the STS, that gives me a TrustException.
If I use the following policy [2] I got this MTOM (?) exception
client side (after getting in the right way the SAML assertion):
[java] org.apache.axis2.AxisFault:
org/apache/axis2/policy/model/MTOMAssertion
[java] at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:747)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:201)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:104)
[java] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:357)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[java] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[java] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[java] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[java] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[java] Caused by: org.apache.axis2.AxisFault:
org/apache/axis2/policy/model/MTOMAssertion
[java] at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
[java] at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
[java] at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
[java] at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
[java] at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
[java] at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
[java] at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
[java] at com.test.TestClient.main(TestClient.java:58)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[1] http://www.mascanc.net/~max/sts1.xml
[2] http://www.mascanc.net/~max/sts2.xml
Thank you,
Massimiliano
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: [Axis2] (Long) Ws-Policy: problem with SAMLtoken and WSAS
example
Posted by Massimiliano Masi <ma...@math.unifi.it>.
Hi,
Quoting Massimiliano Masi <ma...@math.unifi.it>:
> Hi All,
>
> I'm very frustrated: I'm developing policies for getting a SAML 2 token
> from a WS-Trust STS implemented using Rahas.
Another doubt is: in the rampart policy examples, the sample05 shows
how to obtain a SAML Token, but are there any examples that shows how
to use the SAML Token issued?
Since rampart implements security policy 1.1, do I have to implement my
own code, that extends the RampartPolicy to handle the saml2.0 token (maybe,
based on token reference?)
In this case, could you point me on what I've to extend?
The WSAS sample IMHO, has an error: he puts the TokenType in the
RequestSecurityTokenTemplate, that is, an error: the content of this
policy element should be copied directly in the SecondaryParameters of
the wst:RequestSecurityToken, and TokenType is a brother of
SecondaryParameters.
Am I wrong?
Thanks,
Massimiliano
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: [Axis2] (Long) Ws-Policy: problem with SAMLtoken and WSAS example
Posted by Ruchith Fernando <ru...@gmail.com>.
Hi,
Please see my comments below:
On 11/2/07, Massimiliano Masi <ma...@math.unifi.it> wrote:
> Hi All,
>
> I'm very frustrated: I'm developing policies for getting a SAML 2 token
> from a WS-Trust STS implemented using Rahas.
>
> I've to put it in the wsse:Security. So I created the following policy
> for the service that needs the token as is [1] (taken from the WSAS
> example).
>
> I got NPE:
>
Can you please send the request message and the response message you
receive from the STS? Seems like the NPE occurs when Axis2 tries to
handle receive the error message.
>
>
> 19:20:49,721 ERROR [AxisServlet]
> java.lang.NullPointerException
> at
> java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:103)
> at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
> at java.util.ResourceBundle.getString(ResourceBundle.java:285)
> at org.apache.rahas.TrustException.getMessage(TrustException.java:105)
> at org.apache.rahas.TrustException.<init>(TrustException.java:54)
> at org.apache.rahas.TrustException.<init>(TrustException.java:83)
> at
> com.spirit.XUA.utils.SpiritTokenIssuer.issue(SpiritTokenIssuer.java:234)
>
> org.apache.axis2.AxisFault: java.lang.NullPointerException
> at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
> at
> org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:127)
> at
> com.spirit.XUA.utils.XUAAssertions.getAuthenticatedViaWSTrust(XUAAssertions.java:430)
>
>
> So, I cannot access the STS, that gives me a TrustException.
>
> If I use the following policy [2] I got this MTOM (?) exception
> client side (after getting in the right way the SAML assertion):
>
IMHO this policy is not correct.
If you simply need the SAML token added to the wsse:Security header
you should define a SignedSupportingTokens assertion with the issued
token, rather than a ProtectionToken.
Also please include axis2-mtompolicy-<version>.jar file in your
classpath as wll.
Thanks,
Ruchith
p.s. Please subscribe(rampart-dev-subscribe@ws.apache.org) and post
rampart/rahas specific issues in rampart-dev@ws.apache.org list.
>
>
>
> [java] org.apache.axis2.AxisFault:
> org/apache/axis2/policy/model/MTOMAssertion
> [java] at
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
> [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:747)
> [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:201)
> [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:104)
> [java] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [java] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [java] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [java] at java.lang.reflect.Method.invoke(Method.java:585)
> [java] at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
> [java] at org.apache.tools.ant.Task.perform(Task.java:348)
> [java] at org.apache.tools.ant.Target.execute(Target.java:357)
> [java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
> [java] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
> [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
> [java] at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
> [java] at
> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
> [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
> [java] at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
> [java] at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
> [java] Caused by: org.apache.axis2.AxisFault:
> org/apache/axis2/policy/model/MTOMAssertion
> [java] at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> [java] at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> [java] at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> [java] at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> [java] at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> [java] at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
> [java] at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
> [java] at com.test.TestClient.main(TestClient.java:58)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>
>
>
>
>
>
> [1] http://www.mascanc.net/~max/sts1.xml
> [2] http://www.mascanc.net/~max/sts2.xml
>
>
>
> Thank you,
>
>
> Massimiliano
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
http://blog.ruchith.org
http://wso2.org
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org