org.jboss.identity.federation.api.saml.v2.response
Class SAML2Response

java.lang.Object
  extended by org.jboss.identity.federation.api.saml.v2.response.SAML2Response

public class SAML2Response
extends java.lang.Object

API for dealing with SAML2 Response objects

Since:
Jan 5, 2009
Author:
Anil.Saldhana@redhat.com

Constructor Summary
SAML2Response()
           
 
Method Summary
 org.w3c.dom.Document convert(EncryptedElementType encryptedElementType)
           
 org.w3c.dom.Document convert(ResponseType responseType)
           
 AttributeStatementType createAttributeStatement(java.util.List<java.lang.String> roles)
          Given a set of roles, create an attribute statement
 ResponseType createResponseType(java.lang.String ID, IssuerInfoHolder issuerInfo, AssertionType assertion)
           
 ResponseType createResponseType(java.lang.String ID, SPInfoHolder sp, IDPInfoHolder idp, IssuerInfoHolder issuerInfo)
          Create a ResponseType
 void createTimedConditions(AssertionType assertion, long durationInMilis)
          Add validity conditions to the SAML2 Assertion
 AssertionType getAssertionType(java.io.InputStream is)
           
 EncryptedElementType getEncryptedAssertion(java.io.InputStream is)
          Get an encrypted assertion from the stream
 ResponseType getResponseType(java.io.InputStream is)
          Read a ResponseType from an input stream
 void marshall(ResponseType responseType, java.io.OutputStream os)
          Marshall the response type to the output stream
 void marshall(ResponseType responseType, java.io.Writer writer)
          Marshall the ResponseType into a writer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAML2Response

public SAML2Response()
Method Detail

createAttributeStatement

public AttributeStatementType createAttributeStatement(java.util.List<java.lang.String> roles)
Given a set of roles, create an attribute statement

Parameters:
roles -
Returns:

createResponseType

public ResponseType createResponseType(java.lang.String ID,
                                       SPInfoHolder sp,
                                       IDPInfoHolder idp,
                                       IssuerInfoHolder issuerInfo)
                                throws java.lang.Exception
Create a ResponseType

Parameters:
ID - id of the response
sp - holder with the information about the Service Provider
idp - holder with the information on the Identity Provider
issuerInfo - holder with information on the issuer
Returns:
Throws:
java.lang.Exception

createResponseType

public ResponseType createResponseType(java.lang.String ID,
                                       IssuerInfoHolder issuerInfo,
                                       AssertionType assertion)
                                throws java.lang.Exception
Throws:
java.lang.Exception

createTimedConditions

public void createTimedConditions(AssertionType assertion,
                                  long durationInMilis)
                           throws java.lang.Exception
Add validity conditions to the SAML2 Assertion

Parameters:
assertion -
durationInMilis -
Throws:
java.lang.Exception

getEncryptedAssertion

public EncryptedElementType getEncryptedAssertion(java.io.InputStream is)
                                           throws java.lang.Exception
Get an encrypted assertion from the stream

Parameters:
is -
Returns:
Throws:
java.lang.Exception

getAssertionType

public AssertionType getAssertionType(java.io.InputStream is)
                               throws java.lang.Exception
Throws:
java.lang.Exception

getResponseType

public ResponseType getResponseType(java.io.InputStream is)
                             throws java.lang.Exception
Read a ResponseType from an input stream

Parameters:
is -
Returns:
Throws:
java.lang.Exception

convert

public org.w3c.dom.Document convert(EncryptedElementType encryptedElementType)
                             throws java.lang.Exception
Throws:
java.lang.Exception

convert

public org.w3c.dom.Document convert(ResponseType responseType)
                             throws java.lang.Exception
Throws:
java.lang.Exception

marshall

public void marshall(ResponseType responseType,
                     java.io.OutputStream os)
              throws java.lang.Exception
Marshall the response type to the output stream

Note: JAXB marshaller by default picks up arbitrary namespace prefixes (ns2,ns3 etc). The NamespacePrefixMapper is a Sun RI customization that may be needed (this is a TODO) to get a prefix such as saml, samlp

Parameters:
responseType -
os -
Throws:
java.lang.Exception

marshall

public void marshall(ResponseType responseType,
                     java.io.Writer writer)
              throws java.lang.Exception
Marshall the ResponseType into a writer

Parameters:
responseType -
writer -
Throws:
java.lang.Exception


Copyright © 2009 JBoss Inc.. All Rights Reserved.