/**
* 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: FSAttributeStatementHelper.java,v 1.3 2008/06/25 05:47:04 qcheng Exp $
*
*/
/**
* This class helps in creating <code>AttributeStatement</code>s to add
* auto federation attributes as part of an assertion that is generated
* through Single Sign-On.
*/
public class FSAttributeStatementHelper {
/**
* Gets a SAML <code>AttributeStatement</code> by using an
* <code>AutoFederate</code> attribute that is configured in Local Provider.
* @param realm The realm under which the entity resides.
* @param entityID Host Provider's entity ID.
* @param sub Liberty Subject.
* @param ssoToken session of the user
* @return Generated Auto Federate Attribute Statement.
* @exception FSException if an error occurred
*/
throws FSException
{
try {
if (metaManager != null) {
}
} catch (IDFFMetaException fae) {
"AttributeStatement: IDFFMetaException ", fae);
throw new FSException(fae);
}
if (autoFedAttr == null) {
"AttributeStatement: AutoFederate Attribute is null");
}
return null;
}
try {
}
} catch (SessionException se) {
"AttributeStatement: SessionException ", se);
throw new FSException(se);
} catch (DataStoreProviderException ie) {
"AttributeStatement: DataStoreProviderException ", ie);
throw new FSException(ie);
}
"FedAttributeStatement. No values for autofed attribute");
}
return null;
}
try {
} catch (SAMLException ex) {
"AttributeStatement: SAMLException ", ex);
throw new FSException(ex);
}
}
/**
* Gets the SAML Attribute value as a DOM Element.
*/
}
.append("AttributeValue")
.append("AttributeValue>");
try {
return XMLUtils.toDOMDocument(
throw new FSException(ex);
}
}
}