cc.saml
Class SAMLProtocol

java.lang.Object
  extended by cc.saml.SAML
      extended by cc.saml.SAMLAssertion
          extended by cc.saml.SAMLProtocol
Direct Known Subclasses:
SAMLBinding

public class SAMLProtocol
extends SAMLAssertion

Simple examples of coding to the OpenSAML API. Methods here can write SAMLP queries and responses for each of the three main types: authentication, authorization decision, and attributes.


Field Summary
private static java.lang.String QUERY_SUFFIX
           
private static java.lang.String RESPONSE_SUFFIX
           
 
Constructor Summary
SAMLProtocol()
           
 
Method Summary
 AttributeQuery createStockAttributeQuery()
          Creates a file whose contents are a SAML attribute query.
 AuthnQuery createStockAuthnQuery()
          Creates a file whose contents are a SAML authentication query.
 AuthzDecisionQuery createStockAuthzDecisionQuery()
          Creates a file whose contents are a SAML authorization-decision query.
private static void die()
           
static void main(java.lang.String[] args)
          Parses the command line for instructions to write a SAML query or response in one of the three main types, and for a base filename.
 void printResponse(Assertion assertion, java.lang.String filename)
          Helper method to generate and pretty-print a response, based on a given query (for our inResponseTo value) and an assertion.
 
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

QUERY_SUFFIX

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

RESPONSE_SUFFIX

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

SAMLProtocol

public SAMLProtocol()
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 query or response in one of the three main types, and for a base filename. The command methods will automatically append either "Query.xml" or "Response.xml" to the base name.

Throws:
java.lang.Exception

printResponse

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

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

createStockAuthnQuery

public AuthnQuery createStockAuthnQuery()
                                 throws java.lang.Exception
Creates a file whose contents are a SAML authentication query.

Throws:
java.lang.Exception

createStockAttributeQuery

public AttributeQuery createStockAttributeQuery()
                                         throws java.lang.Exception
Creates a file whose contents are a SAML attribute query.

Throws:
java.lang.Exception

createStockAuthzDecisionQuery

public AuthzDecisionQuery createStockAuthzDecisionQuery()
                                                 throws java.lang.Exception
Creates a file whose contents are a SAML authorization-decision query.

Throws:
java.lang.Exception