001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: SPAttributeMapper.java,v 1.3 2008/06/25 05:47:52 qcheng Exp $
026 *
027 */
028
029
030package com.sun.identity.saml2.plugins;
031
032import com.sun.identity.saml2.common.SAML2Exception;
033
034
035/**
036 * This interface <code>SPAttributeMapper</code> is used to map the 
037 * SAML <code>Attribute</code>s  to the local user attributes.
038 * This mapper will be used by the Service Provider that will read
039 * the configured map for the corresponding SAML attributes and
040 * supply to the SAML framework.
041 * The locally mapped attributes returned by the implementation of
042 * this interface will be used by the SAML2 framework to expose
043 * through the single sign-on token to the application. 
044 * Also, the implementation of this mapper may need to consider the deployment
045 * of the SAML v2 plugin base platform for example <code>AccessManager</code>
046 * or the <code>FederationManager</code>.
047 * @see com.sun.identity.saml2.plugins.IDPAttributeMapper
048 *
049 * @supported.all.api
050 */
051
052public interface SPAttributeMapper {
053
054    /**
055     * Returns the map of user attribute values for the corresponding
056     * SAML <code>Attribute</code>s. This attribute value pair map will be
057     * expose by the <code>SAML</code> framework via the Single Sign On
058     * Token. 
059     * @param attributes list of SAML <code>Attribute</code>s.
060     * @param userID universal identifier or the distinguished name (DN) 
061     *        of the user. 
062     * @param hostEntityID <code>EntityID</code> of the hosted provider.  
063     * @param remoteEntityID <code>EntityID</code> of the remote provider.  
064     * @return map of <code>AttributeValuePair</code>s for the given
065     *        SAML <code>Attribute</code> list. 
066     * @exception SAML2Exception if any failure.
067     */
068    public java.util.Map getAttributes(
069        java.util.List attributes,
070        java.lang.String userID,
071        java.lang.String hostEntityID,
072        java.lang.String remoteEntityID,
073        java.lang.String realm 
074    ) throws SAML2Exception;
075
076
077}