CreateIDFFMetaDataTemplate.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 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: CreateIDFFMetaDataTemplate.java,v 1.9 2008/11/18 22:38:19 asyhuang Exp $
*
*/
/**
* Create IDFF Meta Template.
*/
public class CreateIDFFMetaDataTemplate {
private CreateIDFFMetaDataTemplate() {
}
public static String createStandardMetaTemplate(
) throws IDFFMetaException {
}
.append(" xmlns=\"urn:liberty:metadata:2003-08\"\n")
}
}
}
}
private static void addIDFFIdentityProviderTemplate(
) throws IDFFMetaException {
.append(" protocolSupportEnumeration=")
.append("\"urn:liberty:iff:2003-08 urn:liberty:iff:2002-12\">\n");
if (idpSX509Cert != null) {
.append(" <KeyInfo xmlns=\"")
.append("\">\n")
.append(" <X509Data>\n")
.append(" <X509Certificate>\n")
.append(" </X509Certificate>\n")
.append(" </X509Data>\n")
.append(" </KeyInfo>\n")
.append( " </KeyDescriptor>\n");
}
if (idpEX509Cert != null) {
.append(" <EncryptionMethod>http://www.w3.org/2001/04/xmlenc#aes128-cbc</EncryptionMethod>\n")
.append(" <KeySize>128</KeySize>\n")
.append(" <KeyInfo xmlns=\"")
.append("\">\n")
.append(" <X509Data>\n")
.append(" <X509Certificate>\n")
.append(" </X509Certificate>\n")
.append(" </X509Data>\n")
.append(" </KeyInfo>\n")
.append(" </KeyDescriptor>\n");
}
.append("/SOAPReceiver")
.append("</SoapEndpoint>\n")
.append(" <SingleLogoutServiceURL>")
.append("/ProcessLogout")
.append("</SingleLogoutServiceURL>\n")
.append(" <SingleLogoutServiceReturnURL>")
.append("/ReturnLogout")
.append("</SingleLogoutServiceReturnURL>\n")
.append(" <FederationTerminationServiceURL>")
.append("/ProcessTermination")
.append("</FederationTerminationServiceURL>\n")
.append(" <FederationTerminationServiceReturnURL>")
.append("/ReturnTermination")
.append("</FederationTerminationServiceReturnURL>\n")
.append(" <FederationTerminationNotificationProtocolProfile>http://projectliberty.org/profiles/fedterm-sp-http</FederationTerminationNotificationProtocolProfile>\n")
.append(" <FederationTerminationNotificationProtocolProfile>http://projectliberty.org/profiles/fedterm-sp-soap</FederationTerminationNotificationProtocolProfile>\n")
.append(" <SingleLogoutProtocolProfile>http://projectliberty.org/profiles/slo-sp-http</SingleLogoutProtocolProfile>\n")
.append(" <SingleLogoutProtocolProfile>http://projectliberty.org/profiles/slo-sp-soap</SingleLogoutProtocolProfile>\n")
.append(" <RegisterNameIdentifierProtocolProfile>http://projectliberty.org/profiles/rni-sp-http</RegisterNameIdentifierProtocolProfile>\n")
.append(" <RegisterNameIdentifierProtocolProfile>http://projectliberty.org/profiles/rni-sp-soap</RegisterNameIdentifierProtocolProfile>\n")
.append(" <RegisterNameIdentifierServiceURL>")
.append("/ProcessRegistration")
.append("</RegisterNameIdentifierServiceURL>\n")
.append(" <RegisterNameIdentifierServiceReturnURL>")
.append("/ReturnRegistration")
.append("</RegisterNameIdentifierServiceReturnURL>\n")
.append(" <SingleSignOnServiceURL>")
.append("/SingleSignOnService")
.append("</SingleSignOnServiceURL>\n")
.append(" <SingleSignOnProtocolProfile>http://projectliberty.org/profiles/brws-art</SingleSignOnProtocolProfile>\n")
.append(" <SingleSignOnProtocolProfile>http://projectliberty.org/profiles/brws-post</SingleSignOnProtocolProfile>\n")
.append(" <SingleSignOnProtocolProfile>http://projectliberty.org/profiles/lecp</SingleSignOnProtocolProfile>\n")
.append(" </IDPDescriptor>\n");
}
private static void addIDFFServiceProviderTemplate(
) throws IDFFMetaException {
.append(" protocolSupportEnumeration=\n")
.append(" \"urn:liberty:iff:2003-08 urn:liberty:iff:2002-12\">\n");
if (spSX509Cert != null) {
.append(" <KeyInfo xmlns=\"")
.append("\">\n")
.append(" <X509Data>\n")
.append(" <X509Certificate>\n")
.append(" </X509Certificate>\n")
.append(" </X509Data>\n")
.append(" </KeyInfo>\n")
.append(" </KeyDescriptor>\n");
}
if (spEX509Cert != null) {
.append(" <EncryptionMethod>http://www.w3.org/2001/04/xmlenc#aes128-cbc</EncryptionMethod>\n")
.append(" <KeySize>128</KeySize>\n")
.append(" <KeyInfo xmlns=\"")
.append("\">\n")
.append(" <X509Data>\n")
.append(" <X509Certificate>\n")
.append(" </X509Certificate>\n")
.append(" </X509Data>\n")
.append(" </KeyInfo>\n")
.append(" </KeyDescriptor>\n");
}
.append("/SOAPReceiver")
.append("</SoapEndpoint>\n")
.append(" <SingleLogoutServiceURL>")
.append("/ProcessLogout")
.append("</SingleLogoutServiceURL>\n")
.append(" <SingleLogoutServiceReturnURL>")
.append("/ReturnLogout")
.append("</SingleLogoutServiceReturnURL>\n")
.append(" <FederationTerminationServiceURL>")
.append("/ProcessTermination")
.append("</FederationTerminationServiceURL>\n")
.append(" <FederationTerminationServiceReturnURL>")
.append("/ReturnTermination")
.append("</FederationTerminationServiceReturnURL>\n")
.append(" <FederationTerminationNotificationProtocolProfile>http://projectliberty.org/profiles/fedterm-idp-http</FederationTerminationNotificationProtocolProfile>\n")
.append(" <FederationTerminationNotificationProtocolProfile>http://projectliberty.org/profiles/fedterm-idp-soap</FederationTerminationNotificationProtocolProfile>\n")
.append(" <SingleLogoutProtocolProfile>http://projectliberty.org/profiles/slo-idp-http</SingleLogoutProtocolProfile>\n")
.append(" <SingleLogoutProtocolProfile>http://projectliberty.org/profiles/slo-idp-soap</SingleLogoutProtocolProfile>\n")
.append(" <RegisterNameIdentifierProtocolProfile>http://projectliberty.org/profiles/rni-idp-http</RegisterNameIdentifierProtocolProfile>\n")
.append(" <RegisterNameIdentifierProtocolProfile>http://projectliberty.org/profiles/rni-idp-soap</RegisterNameIdentifierProtocolProfile>\n")
.append(" <RegisterNameIdentifierServiceURL>")
.append("/ProcessRegistration")
.append("</RegisterNameIdentifierServiceURL>\n")
.append(" <RegisterNameIdentifierServiceReturnURL>")
.append("/ReturnRegistration")
.append("</RegisterNameIdentifierServiceReturnURL>\n")
.append(" <AssertionConsumerServiceURL id=\"1\" isDefault=\"true\">")
.append("/AssertionConsumerService")
.append("</AssertionConsumerServiceURL>\n")
.append(" <AuthnRequestsSigned>false</AuthnRequestsSigned>\n")
.append(" </SPDescriptor>\n");
}
public static String createExtendedMetaTemplate(
) {
.append(" hosted=\"1\"\n")
.append(" entityID=\"")
.append("\">\n\n");
}
}
}
}
private static void buildIDFFIDPConfigTemplate(
) {
if (idpSCertAlias == null) {
idpSCertAlias = "";
}
if (idpECertAlias == null) {
idpECertAlias = "";
}
.append("\">\n")
.append(" <Attribute name=\"")
.append( "\">\n")
.append(" <Value>active</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>true</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>com.sun.identity.federation.accountmgmt.DefaultFSUserProvider</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>com.sun.identity.federation.services.util.FSNameIdentifierImpl</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>local</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>60</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>180</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>120</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>0</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>context=")
.append("|key=module|value=DataStore|level=0</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" </Attribute>\n")
.append(" </IDPDescriptorConfig>\n");
}
private static void buildIDFFSPConfigTemplate(
) {
if (spSCertAlias == null) {
spSCertAlias = "";
}
if (spECertAlias == null) {
spECertAlias = "";
}
.append("\">\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>active</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>-1</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>http://projectliberty.org/profiles/brws-art</Value>\n")
.append(" <Value>http://projectliberty.org/profiles/brws-post</Value>\n")
.append(" <Value>http://projectliberty.org/profiles/wml-post</Value>\n")
.append(" <Value>http://projectliberty.org/profiles/lecp</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>federated</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>com.sun.identity.federation.accountmgmt.DefaultFSUserProvider</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>com.sun.identity.federation.services.util.FSNameIdentifierImpl</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>remote</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>context=")
.append("|level=0</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>false</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>com.sun.identity.federation.plugins.FSDefaultSPAdapter</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" </Attribute>\n")
.append(" </SPDescriptorConfig>\n");
}
}
private static void addAffiliationTemplate(
) throws IDFFMetaException {
.append(" affiliationID=\"")
.append("\" \n")
.append(" affiliationOwnerID=\"")
.append("\">\n");
}
if (affiSX509Cert != null) {
.append(" <KeyInfo xmlns=\"")
.append("\">\n")
.append(" <X509Data>\n")
.append(" <X509Certificate>\n")
.append(" </X509Certificate>\n")
.append(" </X509Data>\n")
.append(" </KeyInfo>\n")
.append( " </KeyDescriptor>\n");
}
if (affiEX509Cert != null) {
.append(" <EncryptionMethod>http://www.w3.org/2001/04/xmlenc#aes128-cbc</EncryptionMethod>\n")
.append(" <KeySize>128</KeySize>\n")
.append(" <KeyInfo xmlns=\"")
.append("\">\n")
.append(" <X509Data>\n")
.append(" <X509Certificate>\n")
.append(" </X509Certificate>\n")
.append(" </X509Data>\n")
.append(" </KeyInfo>\n")
.append(" </KeyDescriptor>\n");
}
}
private static void buildAffiliationConfigTemplate(
) {
if (affiECertAlias == null) {
affiECertAlias = "";
}
if (affiSCertAlias == null) {
affiSCertAlias = "";
}
.append("\">\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value></Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" <Attribute name=\"")
.append("\">\n")
.append(" <Value>")
.append("</Value>\n")
.append(" </Attribute>\n")
.append(" </AffiliationDescriptorConfig>\n");
}
}