DefaultSiteAttributeMapper.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: DefaultSiteAttributeMapper.java,v 1.2 2009/01/08 04:29:00 hengming Exp $
*
*/
/**
* This class reads Attribute Map in local configuration and maps user's local * attributes to list of <code>Attribute</code> objects to be returned as
* <code>AttributeStatements</code> elements, as part of the
* Authentication Assertion returned to the partner during the
* SSO scenario of Browser Artifact and POST profile.
* <p>
*
*/
public class DefaultSiteAttributeMapper implements ConsumerSiteAttributeMapper {
/**
* Returns <code>List</code> of <code>Attribute</code> objects
*
* @param token User's session.
* @param request The HttpServletRerquest object of the request which
* may contains query attributes to be included in the
* Assertion. This could be null if unavailable.
* @param response The HttpServletResponse object. This could be null
* if unavailable.
* @param targetURL value for TARGET query parameter when the user
* accessing the SAML aware servlet or post profile
* servlet. This could be null if unavailabl
* @return <code>List</code> if <code>Attribute</code> objects.
* <code>Attribute</code> is defined in the SAML SDK as part of
* <code>com.sun.identity.saml.assertion</code> package.
* @throws SAMLException if attributes cannot be obtained.
*/
throws SAMLException {
return null;
}
try {
"getAttributes:", ex);
}
}
if (tokenCount == 1) {
} else if (tokenCount == 2) {
} else {
"getAttribute: invalid saml attribute in attribute " +
" syntax is namespace|attrName.");
}
continue;
}
"getAttribute: user profile does not have " +
"value for " + localAttrName +
" but is going to check ssotoken:");
}
} else {
}
}
if (localAttrValues == null) {
try {
} catch (SessionException ex) {
"getAttribute:", ex);
}
}
}
"getAttribute: user does not have " +
}
} else {
}
"getAttribute: add atttribute = " + samlAttrName +
", attrNamespace = " + attrNamespace +
", values = " + localAttrValues);
}
}
}
}
return samlAttrs;
}
/**
* Returns the SAML <code>Attribute</code> object.
*
* @param name attribute name.
* @param attrNamespace Name format of the attribute
* @param values attribute values.
* @exception SAMLException if any failure.
*/
return null;
}
}
return attribute;
}
/**
* Checks if dynamical profile creation or ignore profile is enabled.
* @param realm realm to check the dynamical profile creation attributes.
* @return true if dynamical profile creation or ignore profile is enabled,
* false otherwise.
*/
try {
"DefaultSiteAttributeMapper.isDynamicalOrIgnoredProfile:" +
" attr = " + tmp);
}
} catch (Exception e) {
"isDynamicalOrIgnoredProfile: unable to get attribute", e);
return false;
}
}
}