Does openws1.4.2 support RequestSecurityToken?
Gina Choi
gchoi at sdl.com
Fri Mar 16 23:18:50 GMT 2012
Hi Brent,
>Actually, I forgot to mention that we do have a rudimentary SOAP client,
>based on Apache HttpClient. There is a basic example of its use here in
>the wiki:
>https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUserManJavaSOAP
ClientExample
>It basically just takes a complete Envelope XMLObject, sends it and
>provides the the Envelope object that is the received back as the
>response. So it doesn't do anything fancy with Envelope handling, like
>generate or process headers, that's something that needs to be done by
>the caller.
I went URL that you mentioned above and following is part the of
HttpSOAPClient example you implemented previously. I try to send
RequestSecurityToken to STS(ADFS2.0) over soap client. Do I need
clientBuilder.setHttpsProtocolSocketFactory(
new TLSProtocolSocketFactory(keyManager, new
DelegateToApplicationX509TrustManager())) ?
What is "client.key" and "client.crt" about?
String clientTLSPrivateKeyResourceName = "client.key";
String clientTLSCertificateResourceName = "client.crt";
Envelope envelope = buildSOAP11Envelope(request);
// SOAP context used by the SOAP client
BasicSOAPMessageContext soapContext = new BasicSOAPMessageContext();
soapContext.setOutboundMessage(envelope);
// This part is for client TLS support
X509Credential clientTLSCred =
getClientTLSCred(clientTLSPrivateKeyResourceName,
clientTLSCertificateResourceName);
StaticClientKeyManager keyManager =
new StaticClientKeyManager(clientTLSCred.getPrivateKey(),
clientTLSCred.getEntityCertificate());
// Build the SOAP client
HttpClientBuilder clientBuilder = new HttpClientBuilder();
clientBuilder.setHttpsProtocolSocketFactory(
new TLSProtocolSocketFactory(keyManager, new
DelegateToApplicationX509TrustManager()));
HttpSOAPClient soapClient = new
HttpSOAPClient(clientBuilder.buildClient(), parserPool);
// Send the message
try {
soapClient.send(serverEndpoint, soapContext);
} catch (SOAPException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
}
Thanks.
Gina
------------------------------
Date: Wed, 14 Mar 2012 16:28:29 -0400
From: Brent Putman <putmanb at georgetown.edu>
Subject: Re: Does openws1.4.2 support RequestSecurityToken?
To: dev at shibboleth.net
Message-ID: <4F60FF6D.4030506 at georgetown.edu>
Content-Type: text/plain; charset=ISO-8859-1
On 3/14/12 1:35 PM, Gina Choi wrote:
> I built AuthnRequest using OpenSAML libraries recently. Is this same
concept?
Yes, it's exactly the same concept. You use builders to create new
instances of the desired XMLObjects, mutate them as you like, build up a
tree that represents the XML you need and then marshall the XMLObject
tree to a DOM.
> Can I find some sample code from anywhere? By the way, my STS is ADFS2.0.
I don't think we have any sample code for the WS-Trust and other WS-*
schemas per se. Possibly there is something in the openws unit tests.
But as I said above, it's exactly the same concept and procedure to
build and marshall a WS-Trust RST XML structure as a SAML 2 AuthnRequest
one.
> I guess that I need to implement SOAO call by myself.
Actually, I forgot to mention that we do have a rudimentary SOAP client,
based on Apache HttpClient. There is a basic example of its use here in
the wiki:
https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUserManJavaSOAPC
lientExample
It basically just takes a complete Envelope XMLObject, sends it and
provides the the Envelope object that is the received back as the
response. So it doesn't do anything fancy with Envelope handling, like
generate or process headers, that's something that needs to be done by
the caller.
------------------------------
--
To unsubscribe from this list send an email to dev-unsubscribe at shibboleth.net
End of dev Digest, Vol 9, Issue 11
**********************************
More information about the dev
mailing list