Marshalling RequestSecurityToken
Gina Choi
gchoi at sdl.com
Mon Mar 19 22:02:54 GMT 2012
------------------------------
Message: 2
Date: Mon, 19 Mar 2012 04:22:55 -1200
From: Gina Choi <gchoi at sdl.com>
Subject: Re: Marshalling RequestSecurityToken
To: <dev at shibboleth.net>, <putmanb at georgetown.edu>
Message-ID:
<199C35CD64E44140A34EB403EA9F7073622F84 at wakemail0303.global.sdl.corp>
Content-Type: text/plain; charset="us-ascii"
Hi Brent,
>Well, that's not really correct either. It "works", but is not how the
>library is intended to be used. You should always obtain builders,
>marshallers and unmarshallers from the factories that are exposed by the
>Configuration singleton. See this page in the wiki for the builder
>examples:
>https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUsrManJavaCreat
>eFromScratch
Last time you mentioned marshalling RequestSecurityToken, but I wasn't quite
understand at that time. Marshalling makes sense when we send SAMLRequest to
STS since we are going to invoke following code.
response.sendRedirect(actionURL + "?SAMLRequest="
+ encodedRequestMessage + "&RelayState=" +
relayUrl);
But when we send RequestSecurityToken to STS over SOAP, we add
RequestSecurityToken to Body. Following code is based on your wiki link. I
did marshaled RequestSecurityToken, but it's purpose was to see xml structure
of the RequestSecurityToken that I build. Just checking with you in case I
missed something.
Body body = (Body)
bf.getBuilder(Body.DEFAULT_ELEMENT_NAME).buildObject(Body.DEFAULT_ELEMENT_NAM
E);
body.getUnknownXMLObjects().add(RequestSecurityToken);
envelope.setBody(body);
// SOAP context used by the SOAP client
BasicSOAPMessageContext soapContext = new BasicSOAPMessageContext();
soapContext.setOutboundMessage(envelope);
HttpClientBuilder clientBuilder = new HttpClientBuilder();
HttpSOAPClient soapClient = new
HttpSOAPClient(clientBuilder.buildClient(), parserPool);
// Send the message
soapClient.send(serverEndpoint, soapContext);
Thanks.
Gina
More information about the dev
mailing list