com.sun.identity.federation.message
Class FSAuthnRequest

java.lang.Object
  extended by com.sun.identity.saml.protocol.AbstractRequest
      extended by com.sun.identity.federation.message.FSAuthnRequest

public class FSAuthnRequest
extends AbstractRequest

The class FSAuthnRequest is used to create , parse AuthnRequest object.


Field Summary
protected  String affiliationID
           
protected  String assertionConsumerServiceID
           
protected  String authContextCompType
           
protected  String consentURI
           
protected  String id
           
protected  int minorVersion
           
protected  FSScoping scoping
           
protected  String signatureString
           
protected  String xmlString
           
 
Fields inherited from class com.sun.identity.saml.protocol.AbstractRequest
issueInstant, majorVersion, requestID, respondWiths, signature, signed, valid
 
Constructor Summary
FSAuthnRequest()
          Default AuthnRequest construtor
FSAuthnRequest(Element root)
          Constructor to create FSAuthnRequest object.
FSAuthnRequest(String requestId, List respondWiths, String providerID, boolean forceAuthn, boolean isPassive, boolean fed, String nameIDPolicy, String protocolProf, RequestAuthnContext authnCxt, String relaySt, String authContextCompType)
          Constructor to create FSAuthnRequest object.
 
Method Summary
 String getAffiliationID()
          Returns the Affliation Identifier.
 String getAssertionConsumerServiceID()
          Returns the Assertion Consumer Service Identifier.
 String getAuthContextCompType()
          Returns the value of AuthContext Comparison attribute.
 RequestAuthnContext getAuthnContext()
          Returns the RequestedAuthnContext object.
 String getConsent()
          Returns the value of consent attribute.
 List getExtensions()
          Returns a list of Extension objects.
 boolean getFederate()
          Returns the value of the Federate attribute.
 boolean getForceAuthn()
          Returns the value of Force Authentication attribute.
 String getID()
          Returns the value of id attribute.
 boolean getIsPassive()
          Returns the value of the isPassive attribute.
 int getMinorVersion()
          Returns the value of the MinorVersion attribute.
 String getNameIDPolicy()
          Returns the NameIDPolicy object.
 String getProtocolProfile()
          Returns the value of ProtocolProfile attribute.
 String getProviderId()
          Returns the value of ProviderID attribute.
 String getRelayState()
          Returns the value of RelayState attribute.
 FSScoping getScoping()
          Returns the FSScoping object.
 String getSignatureString()
          Returns the signature string.
 String getSignedXMLString()
          Returns Signed XML String representation of this object.
static FSAuthnRequest parseBASE64EncodedString(String encodedReq)
          Returns FSAuthnRequest object.
static FSAuthnRequest parseURLEncodedRequest(HttpServletRequest request)
          Returns FSAuthnRequest object.
static FSAuthnRequest parseXML(String xml)
          Returns the FSAuthnRequest object.
 void setAffiliationID(String affiliationID)
          Sets the Affiliation Identifier.
 void setAssertionConsumerServiceID(String assertionConsumerServiceID)
          Sets the Assertion Consumer Service Identifier.
 void setAuthContextCompType(String authType)
          Sets the value of AuthContext Comparison attribute.
 void setAuthnContext(RequestAuthnContext authnCxt)
          Sets the RequestedAuthnContext object.
 void setConsent(String consentURI)
          Sets the value of consent attribute.
 void setExtensions(List extensions)
          Sets Extension objects.
 void setFederate(boolean fed)
          Sets the value of the Federate attribute.
 void setForceAuthn(boolean forceAuthn)
          Sets the value of Force Authentication attribute.
 void setID(String id)
          Sets the value of id attribute.
 void setIsPassive(boolean isPassive)
          Sets the value of the IsPassive attribute.
 void setMinorVersion(int version)
          Sets the value of the MinorVersion attribute.
 void setNameIDPolicy(String nameIDPolicy)
          Sets the NameIDPolicy object.
 void setProtocolProfile(String protocolProf)
          Sets the value of ProtocolProfile attribute.
 void setProviderId(String provId)
          Sets the value of ProviderID attribute.
 void setRelayState(String relaySt)
          Set the value of RelayState attribute.
 void setScoping(FSScoping scoping)
          Sets the FSScoping object.
 boolean setSignature(Element elem)
          Sets the Signature of the Element passed.
 void signXML()
          Unsupported Method.
 void signXML(String certAlias)
          Signs the Request.
 String toBASE64EncodedString()
          Returns a Base64 Encoded String.
 String toURLEncodedQueryString()
          Returns an URL Encoded Query String.
 String toXMLString()
          This method translates the request to an XML document String based on the Request schema described above.
 String toXMLString(boolean includeNS, boolean declareNS)
          Creates a String representation of the <lib:AuthnRequest> element.
 String toXMLString(boolean includeNS, boolean declareNS, boolean includeHeader)
          Creates a String representation of the <lib:AuthnRequest> element.
 
Methods inherited from class com.sun.identity.saml.protocol.AbstractRequest
addRespondWith, getIssueInstant, getMajorVersion, getRequestID, getRespondWith, getSignature, isSignatureValid, isSigned, setIssueInstant, setMajorVersion, setRequestID
 

Field Detail

xmlString

protected String xmlString

signatureString

protected String signatureString

authContextCompType

protected String authContextCompType

id

protected String id

assertionConsumerServiceID

protected String assertionConsumerServiceID

consentURI

protected String consentURI

affiliationID

protected String affiliationID

minorVersion

protected int minorVersion

scoping

protected FSScoping scoping
Constructor Detail

FSAuthnRequest

public FSAuthnRequest()
Default AuthnRequest construtor


FSAuthnRequest

public FSAuthnRequest(String requestId,
                      List respondWiths,
                      String providerID,
                      boolean forceAuthn,
                      boolean isPassive,
                      boolean fed,
                      String nameIDPolicy,
                      String protocolProf,
                      RequestAuthnContext authnCxt,
                      String relaySt,
                      String authContextCompType)
               throws FSMsgException
Constructor to create FSAuthnRequest object.

Parameters:
requestId - the request identifier.
respondWiths - List of respond withs attributes.
providerID - provider id of the requesting provider.
forceAuthn - Force Authentication boolean value.
isPassive - attribute for IDP to be passive or active.
fed - attribute to distingush this request for Federation or SSO
nameIDPolicy - Name ID Policy for this request, possible values are "none", "onetime", "federated", "any".
protocolProf - ProtocolProfile used for the SSO.
authnCxt - Authentication Context used for the SSO.
relaySt - Relay State i.e. original URL to be redirected after SSO.
authContextCompType - AuthContext comparison type.
Throws:
FSMsgException - on error.
FSMsgException

FSAuthnRequest

public FSAuthnRequest(Element root)
               throws FSMsgException
Constructor to create FSAuthnRequest object.

Parameters:
root - the Document Element object.
Throws:
FSMsgException - on error.
FSMsgException
Method Detail

toXMLString

public String toXMLString()
                   throws FSMsgException
This method translates the request to an XML document String based on the Request schema described above. NOTE: this is a complete AuthnRequest xml string with RequestID, MajorVersion, etc.

Returns:
XML String representing the request.
Throws:
FSMsgException - if there is an error.

toXMLString

public String toXMLString(boolean includeNS,
                          boolean declareNS)
                   throws FSMsgException
Creates a String representation of the <lib:AuthnRequest> element.

Parameters:
includeNS - : Determines whether or not the namespace qualifier is prepended to the Element when converted
declareNS - : Determines whether or not the namespace is declared within the Element.
Returns:
string containing the valid XML for this element.
Throws:
FSMsgException - if there is an error.

toXMLString

public String toXMLString(boolean includeNS,
                          boolean declareNS,
                          boolean includeHeader)
                   throws FSMsgException
Creates a String representation of the <lib:AuthnRequest> element.

Parameters:
includeNS - Determines whether or not the namespace qualifier is prepended to the Element when converted
declareNS - Determines whether or not the namespace is declared within the Element.
includeHeader - Determines whether the output include the xml declaration header.
Returns:
A string containing the valid XML for this element.
Throws:
FSMsgException - if there is an error.

parseXML

public static FSAuthnRequest parseXML(String xml)
                               throws FSMsgException
Returns the FSAuthnRequest object.

Parameters:
xml - the XML string.
Returns:
FSAuthnRequest object.
Throws:
FSMsgException - if there is error creating the object.

getSignedXMLString

public String getSignedXMLString()
Returns Signed XML String representation of this object.

Returns:
signed XML String.

getSignatureString

public String getSignatureString()
Returns the signature string.

Returns:
the signature string.

getExtensions

public List getExtensions()
Returns a list of Extension objects. Each entry of the list is a Extension object.

Returns:
a list of Extension elements.
See Also:
FSAuthnRequest.setExtensions(List)

setExtensions

public void setExtensions(List extensions)
Sets Extension objects. Each entry of the list is a Extension object.

Parameters:
extensions - a list of Extension objects.
See Also:
FSAuthnRequest.getExtensions()

getForceAuthn

public boolean getForceAuthn()
Returns the value of Force Authentication attribute.

Returns:
the value of Force Authentication attribute.

setForceAuthn

public void setForceAuthn(boolean forceAuthn)
Sets the value of Force Authentication attribute.

Parameters:
forceAuthn - value of Force Authentication attribute.

getIsPassive

public boolean getIsPassive()
Returns the value of the isPassive attribute.

Returns:
value of isPassive attribute.

setIsPassive

public void setIsPassive(boolean isPassive)
Sets the value of the IsPassive attribute.

Parameters:
isPassive - value of isPassive attribute.

getFederate

public boolean getFederate()
Returns the value of the Federate attribute.

Returns:
the value fo the Federate attribute.

setFederate

public void setFederate(boolean fed)
Sets the value of the Federate attribute.

Parameters:
fed - the value of the Federate attribute.

getNameIDPolicy

public String getNameIDPolicy()
Returns the NameIDPolicy object.

Returns:
the NameIDPolicy object.
See Also:
FSAuthnRequest.setNameIDPolicy(String)

setNameIDPolicy

public void setNameIDPolicy(String nameIDPolicy)
Sets the NameIDPolicy object.

Parameters:
nameIDPolicy - the new NameIDPolicy object.
See Also:
FSAuthnRequest.getNameIDPolicy()

getProtocolProfile

public String getProtocolProfile()
Returns the value of ProtocolProfile attribute.

Returns:
the value of ProtocolProfile attribute.
See Also:
FSAuthnRequest.setProtocolProfile(String)

setProtocolProfile

public void setProtocolProfile(String protocolProf)
Sets the value of ProtocolProfile attribute.

Parameters:
protocolProf - the value of ProtocolProfile attribute.
See Also:
FSAuthnRequest.getProtocolProfile()

getRelayState

public String getRelayState()
Returns the value of RelayState attribute.

Returns:
the value of RelayState attribute.
See Also:
FSAuthnRequest.setRelayState(String)

setRelayState

public void setRelayState(String relaySt)
Set the value of RelayState attribute.

Parameters:
relaySt - the value of RelayState attribute.
See Also:
FSAuthnRequest.getRelayState()

getAuthnContext

public RequestAuthnContext getAuthnContext()
Returns the RequestedAuthnContext object.

Returns:
the RequestedAuthnContext object.
See Also:
FSAuthnRequest.setAuthnContext(RequestAuthnContext)

setAuthnContext

public void setAuthnContext(RequestAuthnContext authnCxt)
Sets the RequestedAuthnContext object.

Parameters:
authnCxt - the RequestAuthnContext object.
See Also:
FSAuthnRequest.getAuthnContext()

getProviderId

public String getProviderId()
Returns the value of ProviderID attribute.

Returns:
the value of ProviderID attribute.
See Also:
FSAuthnRequest.setProviderId(String).

setProviderId

public void setProviderId(String provId)
Sets the value of ProviderID attribute.

Parameters:
provId - the value of ProviderID attribute.
See Also:
FSAuthnRequest.getProviderId()

getAuthContextCompType

public String getAuthContextCompType()
Returns the value of AuthContext Comparison attribute.

Returns:
he value of AuthContext Comparison attribute.
See Also:
FSAuthnRequest.setAuthContextCompType(String)

setAuthContextCompType

public void setAuthContextCompType(String authType)
Sets the value of AuthContext Comparison attribute.

Parameters:
authType - he value of AuthContext Comparison attribute.
See Also:
FSAuthnRequest.getAuthContextCompType()

getID

public String getID()
Returns the value of id attribute.

Returns:
the value of id attribute.
See Also:
FSAuthnRequest.setID(String)

setID

public void setID(String id)
Sets the value of id attribute.

Parameters:
id - the value of id attribute.
See Also:
FSAuthnRequest.getID()

getMinorVersion

public int getMinorVersion()
Returns the value of the MinorVersion attribute.

Overrides:
getMinorVersion in class AbstractRequest
Returns:
the value of the MinorVersion attribute.
See Also:
FSAuthnRequest.setMinorVersion(int)

setMinorVersion

public void setMinorVersion(int version)
Sets the value of the MinorVersion attribute.

Overrides:
setMinorVersion in class AbstractRequest
Parameters:
version - the value of the MinorVersion attribute.
See Also:
FSAuthnRequest.getMinorVersion()

getAffiliationID

public String getAffiliationID()
Returns the Affliation Identifier.

Returns:
the Affliation Identifier.
See Also:
FSAuthnRequest.setAffiliationID(String)

setAffiliationID

public void setAffiliationID(String affiliationID)
Sets the Affiliation Identifier.

Parameters:
affiliationID - the Affiliation Identifier.
See Also:
FSAuthnRequest.getAffiliationID()

getAssertionConsumerServiceID

public String getAssertionConsumerServiceID()
Returns the Assertion Consumer Service Identifier.

Returns:
the Assertion Consumer Service Identifier.
See Also:
FSAuthnRequest.setAssertionConsumerServiceID(String)

setAssertionConsumerServiceID

public void setAssertionConsumerServiceID(String assertionConsumerServiceID)
Sets the Assertion Consumer Service Identifier.

Parameters:
assertionConsumerServiceID - the Assertion Consumer Service Identifier.
See Also:
FSAuthnRequest.getAssertionConsumerServiceID()

getConsent

public String getConsent()
Returns the value of consent attribute.

Returns:
the value of consent attribute.
See Also:
FSAuthnRequest.setConsent(String)

setConsent

public void setConsent(String consentURI)
Sets the value of consent attribute.

Parameters:
consentURI - the value of consent attribute.
See Also:
FSAuthnRequest.getConsent()

setScoping

public void setScoping(FSScoping scoping)
Sets the FSScoping object.

Parameters:
scoping - the FSScoping object.
See Also:
FSAuthnRequest.getScoping()

getScoping

public FSScoping getScoping()
Returns the FSScoping object.

Returns:
the FSScoping object.
See Also:
FSAuthnRequest.setScoping(FSScoping)

toURLEncodedQueryString

public String toURLEncodedQueryString()
                               throws FSMsgException
Returns an URL Encoded Query String.

Returns:
a url encoded query string.
Throws:
FSMsgException - if there is an error.

toBASE64EncodedString

public String toBASE64EncodedString()
                             throws FSMsgException
Returns a Base64 Encoded String.

Returns:
a Base64 Encoded String.
Throws:
FSMsgException - if there is an error encoding the string.

parseURLEncodedRequest

public static FSAuthnRequest parseURLEncodedRequest(HttpServletRequest request)
                                             throws FSMsgException
Returns FSAuthnRequest object. The object is creating by parsing the HttpServletRequest object.

Parameters:
request - the HttpServletRequest object.
Throws:
FSMsgException - if there is an error creating FSAuthnRequest object.

parseBASE64EncodedString

public static FSAuthnRequest parseBASE64EncodedString(String encodedReq)
                                               throws FSMsgException
Returns FSAuthnRequest object. The object is created by parsing an Base64 encode authentication request string.

Parameters:
encodedReq - the encode string
Throws:
FSMsgException - if there is an error creating FSAuthnRequest object.

signXML

public void signXML(String certAlias)
             throws SAMLException
Signs the Request.

Parameters:
certAlias - the Certificate Alias.
Throws:
XMLSignatureException - if FSAuthnRequest cannot be signed.
SAMLException

signXML

public void signXML()
             throws SAMLException
Unsupported Method.

Specified by:
signXML in class AbstractRequest
Throws:
SAMLException - If could not sign the object.

setSignature

public boolean setSignature(Element elem)
Sets the Signature of the Element passed.

Overrides:
setSignature in class AbstractRequest
Parameters:
elem - the Document Element.
Returns:
true if success otherwise false.