com.sun.identity.federation.message
Class FSAuthnRequest

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

public class FSAuthnRequest
extends AbstractRequest

The class FSAuthnRequest is used to create or parse AuthnRequest.


Constructor Summary
FSAuthnRequest()
          Default AuthnRequest constructor
FSAuthnRequest(org.w3c.dom.Element root)
          Constructor
FSAuthnRequest(java.lang.String requestId, java.util.List respondWiths, java.util.List signatures, java.lang.String providerID, boolean forceAuthn, boolean isPassive, boolean fed, java.lang.String nameIDPolicy, java.lang.String protocolProf, RequestAuthnContext authnCxt, java.lang.String relaySt, java.lang.String authContextCompType)
          Constructor
 
Method Summary
 java.lang.String getAffiliationID()
          Gets affiliation ID
 java.lang.String getAssertionConsumerServiceID()
          Gets AssertionConsumerServiceID parameter.
 java.lang.String getAuthContextCompType()
          Gets authentication context comparison type.
 RequestAuthnContext getAuthnContext()
          Gets RequestAuthnContext element
 java.lang.String getConsent()
          Gets Consent element
 boolean getFederate()
          Gets Federate param.
 boolean getForceAuthn()
          Get Force Authentication param
 java.lang.String getID()
          Gets id attribute.
 boolean getIsPassive()
          Gets IsPassive param
 int getMinorVersion()
          Gets minor version
 java.lang.String getNameIDPolicy()
          Gets NameIDPolicy param.
 java.lang.String getProtocolProfile()
          Gets ProtocolProfile parameter.
 java.lang.String getProviderId()
          Gets provider ID for this request.
 java.lang.String getRelayState()
          Gets RelayState parameter
 FSScoping getScoping()
          Gets the scoping element.
 java.lang.String getSignatureString()
          Get the Signature Element as string
 java.lang.String getSignedXMLString()
          Get Signed XML String.
static FSAuthnRequest parseBASE64EncodedString(java.lang.String encodedReq)
          Gets the FSAuthnRequest from the BASE64 encoded format.
static FSAuthnRequest parseURLEncodedRequest(javax.servlet.http.HttpServletRequest request)
          Gets the FSAuthnRequest from the query parameters.
static FSAuthnRequest parseXML(java.lang.String xml)
          Parses the XML and creates an FSAuthnRequest object
 void setAffiliationID(java.lang.String affiliationID)
          Sets affiliation ID
 void setAssertionConsumerServiceID(java.lang.String assertionConsumerServiceID)
          Sets AssertionConsumerServiceID parameter.
 void setAuthContextCompType(java.lang.String authType)
          Sets authentication context comparison type.
 void setAuthnContext(RequestAuthnContext authnCxt)
          Sets RequestAuthnContext element
 void setConsent(java.lang.String uri)
          Sets Consent attribute
 void setFederate(boolean fed)
          Sets Federate param.
 void setForceAuthn(boolean forceAuthn)
          Sets force authentication
 void setID(java.lang.String id)
          Sets id attribute.
 void setIsPassive(boolean isPassive)
          Sets IsPassive param
 void setMinorVersion(int version)
          Sets minor version
 void setNameIDPolicy(java.lang.String nameIDPolicy)
          Sets NameIDPolicy param.
 void setProtocolProfile(java.lang.String protocolProf)
          Sets ProtocolProfile parameter.
 void setProviderId(java.lang.String provId)
          Sets provider ID for this request.
 void setRelayState(java.lang.String relaySt)
          Sets RelayState parameter
 void setScoping(FSScoping scoping)
          Sets the scoping element.
 boolean setSignature(org.w3c.dom.Element elem)
          Sets the Signature.
 void signXML()
          Signs the AuthnRequest.
 void signXML(java.lang.String certAlias)
          Signs the AuthnRequest.
 java.lang.String toBASE64EncodedString()
          Gets the BASE 64 encoded format of the request
 java.lang.String toURLEncodedQueryString()
          Gets the URL encoded string format of the request.
 java.lang.String toXMLString()
          Creates a String representation of the <lib:AuthnRequest> element.
 java.lang.String toXMLString(boolean includeNS, boolean declareNS)
          Creates a String representation of the <lib:AuthnRequest> element.
 java.lang.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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSAuthnRequest

public FSAuthnRequest()
Default AuthnRequest constructor


FSAuthnRequest

public FSAuthnRequest(java.lang.String requestId,
                      java.util.List respondWiths,
                      java.util.List signatures,
                      java.lang.String providerID,
                      boolean forceAuthn,
                      boolean isPassive,
                      boolean fed,
                      java.lang.String nameIDPolicy,
                      java.lang.String protocolProf,
                      RequestAuthnContext authnCxt,
                      java.lang.String relaySt,
                      java.lang.String authContextCompType)
               throws FSMsgException
Constructor

Parameters:
requestId - RequestID, if null, the constructor will create one.
respondWiths - List of respond withs
signatures - List of signature elements
providerID - provider id of the requesting provider
forceAuthn - Force Authentication
isPassive - parameter to tell the IDP to be passive
fed - variable to distinguish 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 - if unable to construct the object

FSAuthnRequest

public FSAuthnRequest(org.w3c.dom.Element root)
               throws FSMsgException
Constructor

Parameters:
root - AuthnRequest XML root element
Throws:
FSMsgException - if error occurs during parsing
Method Detail

toXMLString

public java.lang.String toXMLString()
                             throws FSMsgException
Creates a String representation of the <lib:AuthnRequest> element. NOTE: this is a complete AuthnRequest xml string with RequestID, MajorVersion, etc.

Returns:
XML String representing the request.
Throws:
FSMsgException - if error occurs.

toXMLString

public java.lang.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:
A string containing the valid XML for this element
Throws:
FSMsgException - if error occurs.

toXMLString

public java.lang.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 error occurs.

parseXML

public static FSAuthnRequest parseXML(java.lang.String xml)
                               throws FSMsgException
Parses the XML and creates an FSAuthnRequest object

Parameters:
xml - XML String
Returns:
FSAuthnRequest object
Throws:
FSMsgException - if unable to construct the object.

getSignedXMLString

public java.lang.String getSignedXMLString()
Get Signed XML String.

Returns:
signed XML String, null if the FSAuthnRequest is not signed.

getSignatureString

public java.lang.String getSignatureString()
Get the Signature Element as string

Returns:
Signature string, null if the FSAuthnRequest is not signed.

getForceAuthn

public boolean getForceAuthn()
Get Force Authentication param

Returns:
boolean true or false

setForceAuthn

public void setForceAuthn(boolean forceAuthn)
Sets force authentication

Parameters:
forceAuthn - boolean variable

getIsPassive

public boolean getIsPassive()
Gets IsPassive param

Returns:
IsPassive param

setIsPassive

public void setIsPassive(boolean isPassive)
Sets IsPassive param

Parameters:
isPassive - IsPassive param

getFederate

public boolean getFederate()
Gets Federate param. This is for ID-FF version 1.1 only.

Returns:
Federate param

setFederate

public void setFederate(boolean fed)
Sets Federate param. This is for ID-FF version 1.1 only.

Parameters:
fed - Federate attribute to be set

getNameIDPolicy

public java.lang.String getNameIDPolicy()
Gets NameIDPolicy param.

Returns:
NameIDPolicy attribute.

setNameIDPolicy

public void setNameIDPolicy(java.lang.String nameIDPolicy)
Sets NameIDPolicy param.

Parameters:
nameIDPolicy - NameIDPolicy attribute.

getProtocolProfile

public java.lang.String getProtocolProfile()
Gets ProtocolProfile parameter.

Returns:
ProtocolProfile parameter.

setProtocolProfile

public void setProtocolProfile(java.lang.String protocolProf)
Sets ProtocolProfile parameter.

Parameters:
protocolProf - ProtocolProfile parameter.

getRelayState

public java.lang.String getRelayState()
Gets RelayState parameter

Returns:
RelayState parameter

setRelayState

public void setRelayState(java.lang.String relaySt)
Sets RelayState parameter

Parameters:
relaySt - RelayState parameter to be set

getAuthnContext

public RequestAuthnContext getAuthnContext()
Gets RequestAuthnContext element

Returns:
RequestAuthnContext element

setAuthnContext

public void setAuthnContext(RequestAuthnContext authnCxt)
Sets RequestAuthnContext element

Parameters:
authnCxt - RequestAuthnContext to be set.

getProviderId

public java.lang.String getProviderId()
Gets provider ID for this request.

Returns:
provider id.

setProviderId

public void setProviderId(java.lang.String provId)
Sets provider ID for this request.

Parameters:
provId - provider ID to be set.

getAuthContextCompType

public java.lang.String getAuthContextCompType()
Gets authentication context comparison type.

Returns:
authentication context comparison type.

setAuthContextCompType

public void setAuthContextCompType(java.lang.String authType)
Sets authentication context comparison type.

Parameters:
authType - authentication context comparison type to be set.

getID

public java.lang.String getID()
Gets id attribute. This is for ID-FF 1.1 only.

Returns:
id attribute.

setID

public void setID(java.lang.String id)
Sets id attribute. This is for ID-FF 1.1 only.

Parameters:
id - id to be set.

getMinorVersion

public int getMinorVersion()
Gets minor version

Overrides:
getMinorVersion in class AbstractRequest
Returns:
minor version

setMinorVersion

public void setMinorVersion(int version)
Sets minor version

Overrides:
setMinorVersion in class AbstractRequest
Parameters:
version - minor version to be set

getAffiliationID

public java.lang.String getAffiliationID()
Gets affiliation ID

Returns:
affiliation ID

setAffiliationID

public void setAffiliationID(java.lang.String affiliationID)
Sets affiliation ID

Parameters:
affiliationID - affiliation ID to be set

getAssertionConsumerServiceID

public java.lang.String getAssertionConsumerServiceID()
Gets AssertionConsumerServiceID parameter.

Returns:
assertion consumer service id.

setAssertionConsumerServiceID

public void setAssertionConsumerServiceID(java.lang.String assertionConsumerServiceID)
Sets AssertionConsumerServiceID parameter.

Parameters:
assertionConsumerServiceID - assertion consumer service id to be set.

getConsent

public java.lang.String getConsent()
Gets Consent element

Returns:
Consent element

setConsent

public void setConsent(java.lang.String uri)
Sets Consent attribute

Parameters:
uri - Consent attribute

setScoping

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

Parameters:
scoping - scoping element.

getScoping

public FSScoping getScoping()
Gets the scoping element.

Returns:
FSScoping scoping element.

toURLEncodedQueryString

public java.lang.String toURLEncodedQueryString()
                                         throws FSMsgException
Gets the URL encoded string format of the request.

Returns:
URL encoded string format of the request.
Throws:
FSMsgException - if unable to convert the request.

toBASE64EncodedString

public java.lang.String toBASE64EncodedString()
                                       throws FSMsgException
Gets the BASE 64 encoded format of the request

Returns:
BASE 64 encoded string of the request
Throws:
FSMsgException - if unable to get the BASE 64 encoded format.

parseURLEncodedRequest

public static FSAuthnRequest parseURLEncodedRequest(javax.servlet.http.HttpServletRequest request)
                                             throws FSMsgException
Gets the FSAuthnRequest from the query parameters.

Parameters:
request - HttpServletRequest to retrieve query parameters
Returns:
the FSAuthnRequest object
Throws:
FSMsgException - if unable to construct the object.

parseBASE64EncodedString

public static FSAuthnRequest parseBASE64EncodedString(java.lang.String encodedReq)
                                               throws FSMsgException
Gets the FSAuthnRequest from the BASE64 encoded format.

Parameters:
encodedReq - FSAuthnRequest in BASE64 encoded string.
Returns:
the FSAuthnRequest object.
Throws:
FSMsgException - if unable to construct the object.

signXML

public void signXML(java.lang.String certAlias)
             throws SAMLException
Signs the AuthnRequest.

Parameters:
certAlias - certification Alias used to sign the AuthnRequest
Throws:
SAMLException - if it could not sign the AuthnRequest

signXML

public void signXML()
             throws SAMLException
Signs the AuthnRequest.

Specified by:
signXML in class AbstractRequest
Throws:
SAMLException - if it could not sign the AuthnRequest

setSignature

public boolean setSignature(org.w3c.dom.Element elem)
Sets the Signature.

Overrides:
setSignature in class AbstractRequest
Parameters:
elem - Signature element.
Returns:
true if setting successful, false otherwise


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.