Yes it is possible. You'll need to inject the WebServiceContext as a
@Resource into your implementation:

@Resource
WebServiceContext wsContext;

Then you can access the SAML Assertion via something like:

MessageContext ctx = wsContext.getMessageContext();
SecurityContext secCtx =
(SecurityContext)ctx.get(SecurityContext.class.getName());
if (secCtx instanceof SAMLSecurityContext) {
            // ((SAMLSecurityContext)secCtx).getAssertionElement();
}

Colm.


On Sat, Jun 8, 2013 at 1:14 AM, patch_78 <[email protected]> wrote:

> Hi,
>
> I have a web service that requires SAML2 token from a STS (in client
> requests). How can I retrieve the token from the web service implementation
> class? Is it possible?
>
> This is my web service implementation class
> ******************************************************
> @WebService(targetNamespace =
> "http://nels.no/eup/service/data/contract/Datastorage";,
>             portName="DatastoragePort",
>             serviceName="DatastorageService",
>
>
> endpointInterface="no.nels.eup.service.data.contract.datastorage.DatastoragePortType")
> public class DatastoragePortTypeImpl implements DatastoragePortType {
>
> public ListAllCollectionsResponse getCollection(ListAllCollections
> parameters) { .... }
>
> }
> ******************************************************
>
> patch
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/How-to-retrieve-Token-from-WSP-tp5729004.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Colm O hEigeartaigh

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

Reply via email to