cc.saml
Class SAMLBinding

java.lang.Object
  extended by cc.saml.SAML
      extended by cc.saml.SAMLAssertion
          extended by cc.saml.SAMLProtocol
              extended by cc.saml.SAMLBinding

public class SAMLBinding
extends SAMLProtocol

Simple examples of coding to the OpenSAML API. Methods here can read and write SAML assertions, queries, and responses using bindings including SOAP 1.1 over HTTP. (Nothing in this class performs any actual HTTP messaging, however: we continue to represent I/O using files and console streams.)


Field Summary
private static java.lang.String REQUEST_SUFFIX
           
private static java.lang.String RESPONSE_SUFFIX
           
 
Constructor Summary
SAMLBinding()
           
 
Method Summary
private static void die()
           
static void main(java.lang.String[] args)
          Parses the command line for instructions to write a SAML request or response in one of the three main types, and for a base filename.
 void wrapAndPrintResponse(Assertion assertion, java.lang.String filename)
          Helper method to generate and pretty-print a SOAP response envelope, based on a given request envelope (for our inResponseTo value) and a pre-built assertion.
 void wrapAndPrintToFile(XMLObject object, java.lang.String filename)
          Helper method to generate and pretty-print a SOAP envelope, based on an XML object and a filename.
 
Methods inherited from class cc.saml.SAMLProtocol
createStockAttributeQuery, createStockAuthnQuery, createStockAuthzDecisionQuery, printResponse
 
Methods inherited from class cc.saml.SAMLAssertion
createStockAttributeAssertion, createStockAuthnAssertion, createStockAuthzDecisionAssertion, readAttributeAssertion, readAuthnAssertion, readAuthzDecisionAssertion
 
Methods inherited from class cc.saml.SAML
addAttribute, addToElement, asDOMDocument, create, createAssertion, createAttributeAssertion, createAuthnAssertion, createResponse, createResponse, createResponse, createResponse, createSubject, fromElement, printToFile, readFromFile, spawnIssuer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_SUFFIX

private static final java.lang.String REQUEST_SUFFIX
See Also:
Constant Field Values

RESPONSE_SUFFIX

private static final java.lang.String RESPONSE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

SAMLBinding

public SAMLBinding()
Method Detail

die

private static void die()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Parses the command line for instructions to write a SAML request or response in one of the three main types, and for a base filename. The command methods will automatically append either "Request.xml" or "Response.xml" to the base name. The file content in each case will be a SOAP Envelope, wrapping the request or response as the message body according to the SAML 2.0 SOAP binding.

Throws:
java.lang.Exception

wrapAndPrintToFile

public void wrapAndPrintToFile(XMLObject object,
                               java.lang.String filename)
                        throws java.io.IOException,
                               MarshallingException,
                               javax.xml.transform.TransformerException
Helper method to generate and pretty-print a SOAP envelope, based on an XML object and a filename.

Throws:
java.io.IOException
MarshallingException
javax.xml.transform.TransformerException

wrapAndPrintResponse

public void wrapAndPrintResponse(Assertion assertion,
                                 java.lang.String filename)
                          throws java.io.IOException,
                                 MarshallingException,
                                 javax.xml.transform.TransformerException
Helper method to generate and pretty-print a SOAP response envelope, based on a given request envelope (for our inResponseTo value) and a pre-built assertion.

Throws:
java.io.IOException
MarshallingException
javax.xml.transform.TransformerException