FSAuthnRequestEnvelope.java revision 9f262a16efd2216a0d2a6792b8a13eba2756bacb
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: FSAuthnRequestEnvelope.java,v 1.2 2008/06/25 05:46:43 qcheng Exp $
* Portions Copyrighted 2014 ForgeRock AS
*/
/**
* This class defines methods for setting and retrieving attributes and
* elements associated with a Liberty Authentication Request.
*
* @supported.all.api
* @deprecated since 12.0.0
*/
public class FSAuthnRequestEnvelope {
private boolean isPassive = false;
/**
* Default Constructor.
*/
public FSAuthnRequestEnvelope() {
}
/**
* Constructs a new <code>FSAuthnRequestEnvelope</code> object.
*
* @param authnRequest the authentication request
* @param providerID the provider's identifier
* @param providerName name of the provider
* @param assertionConsumerServiceURL absolute url of the assertion
* consumer service
* @param idpList list of identity providers
* @param isPassive true if identity provider must not interact
* with the <code>Principal</code>.
*/
this.authnRequest = authnRequest;
this.providerID = providerID;
this.providerName = providerName;
}
/**
* Constructs a new <code>FSAuthnRequestEnvelope</code> object
* from a Document Element.
*
* @param root the Document Element .
* @throws FSMsgException if there is an error
* creating this object.
*/
"FSAuthnRequestEnvelope.parseXML: null input.");
}
"FSAuthnRequestEnvelope.parseXML: wrong input.");
}
+ " No namespace");
}
}
for (int i = 0; i < length; i++) {
boolean isPassive = false;
if (strIsPassive != null &&
isPassive = true;
}
}
}
}
}
/**
* Returns the value of <code>MinorVersion</code> property.
*
* @return the value of <code>MinorVersion</code> property.
*/
public int getMinorVersion() {
return minorVersion;
}
/**
* Sets the value of <code>MinorVersion</code> property.
*
* @param minorVersion the value of <code>MinorVersion</code> property.
* @see #setMinorVersion(int)
*/
public void setMinorVersion(int minorVersion) {
this.minorVersion = minorVersion;
}
/**
* Returns the request as an XML Document String
* based on the Liberty Request schema.
*
* @return XML String representing the request.
* @throws <code>FSMsgException</code> if there is an error.
*/
return toXMLString(true, true);
}
/**
* Creates a String representation of the <lib:AuthnRequest> element.
* @param includeNS : Determines whether or not the namespace qualifier
* is prepended to the Element when converted
* @param declareNS : Determines whether or not the namespace is declared
* within the Element.
* @return String containing the valid XML for this element.
* @throws FSMsgException if there is an error.
*/
throws FSMsgException {
}
/**
* Creates a String representation of the <lib:AuthnRequest> element.
*
* @param includeNS Determines whether or not the namespace qualifier
* is prepended to the Element when converted
* @param declareNS Determines whether or not the namespace is declared
* within the Element.
* @param includeHeader Determines whether the output include the xml
* declaration header.
* @return A string containing the valid XML for this element.
* @throws <code>FSMsgException</code> if there is an error.
*/
boolean declareNS,
boolean includeHeader) throws FSMsgException {
if (includeHeader) {
}
if (includeNS) {
}
if (declareNS) {
} else {
}
}
if (authnRequest != null){
}
}
.append("ProviderName")
}
if (assertionConsumerServiceURL != null &&
}
}
if (isPassive) {
}
//Other elements needs to be handled here
}
/**
* Returns the <code>FSAuthnRequestEnvelope</code> object.
*
* @param xml the XML string to create this object from
* @return <code>FSAuthnRequestEnvelope</code> object.
* @throws FSMsgException if there is
* error creating the object.
*/
throws FSMsgException {
"FSAuthnRequestEnvelope.parseXML:Error "
+ "while parsing input xml string");
}
}
return new FSAuthnRequestEnvelope(root);
}
/**
* Returns the value of <code>AssertionConsumerServiceURL</code> attribute.
*
* @return the value of <code>AssertionConsumerServiceURL</code> attribute.
* @see #setAssertionConsumerServiceURL(String)
*/
public String getAssertionConsumerServiceURL() {
return assertionConsumerServiceURL;
}
/**
* Sets the value of <code>AssertionConsumerServiceURL</code> attribute.
*
* @param assertionConsumerURL the value of
* <code>AssertionConsumerServiceURL</code> attribute.
* @see #getAssertionConsumerServiceURL
*/
}
/**
* Returns the <code>FSAuthnRequest</code> object.
*
* @return the <code>FSAuthnRequest</code> object.
* @see #setAuthnRequest(FSAuthnRequest)
*/
public FSAuthnRequest getAuthnRequest() {
return authnRequest;
}
/**
* Sets the <code>FSAuthnRequest</code> object.
*
* @param authnRequest the <code>FSAuthnRequest</code> object.
* @see #getAuthnRequest
*/
this.authnRequest = authnRequest;
}
/**
* Returns the <code>FSIDPList</code> object.
*
* return the <code>FSIDPList</code> object.
* @see #setIDPList(FSIDPList)
*/
public FSIDPList getIDPList() {
return idpList;
}
/**
* Sets the <code>FSIDPList</code> object.
*
* @param idpList the <code>FSIDPList</code> object.
* @see #getIDPList
*/
}
/**
* Returns a list of elements.
*
* @return list of elements.
* @see #setOtherElements(List)
*/
public List getOtherElements() {
return otherElements;
}
/**
* Sets a list of elements.
*
* @param otherElements a list of elements.
* @see #getOtherElements
*/
this.otherElements = otherElements;
}
/**
* Returns <code>FSAuthnRequestEnvelope</code> object. The object
* is created by parsing an Base64 encode authentication
* request String.
*
* @param encodedReq the encoded string.
* @throws <code>FSMsgException</code> if there is an error
* creating <code>FSAuthnRequestEnvelope</code> object.
*/
public static FSAuthnRequestEnvelope parseBASE64EncodedString(
if (encodedReq != null) {
+ "parseBASE64EncodedString: decoded input string: \n"
+ decodedAuthnReq);
}
return parseXML(decodedAuthnReq);
} else {
"FSAuthnRequestEnvelope.parseBASE64EncodedString: null "
+ " String passed in as argument.");
}
}
}
/**
* Returns a Base64 Encoded Authentication Request String.
*
* @return a Base64 Encoded Authentication Request String.
* @throws FSMsgException if there is an error encoding
* the string.
*/
if((assertionConsumerServiceURL == null) ||
+ "assertionConsumerServiceURL is null in the "
+ "FSAuthnRequestEnvelope");
throw new FSMsgException(
"noAssertionConsumerServiceURLElement",null);
}
if (authnRequest == null){
+ "authnRequest is null in the FSAuthnRequestEnvelope");
}
}
}