001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2007 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:48:07 qcheng Exp $
026 *
027 */
028
029
030package com.sun.identity.wsfederation.plugins;
031
032import com.sun.identity.wsfederation.common.WSFederationException;
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 WS-Federation implementation base platform for example 
046 * <code>AccessManager</code>
047 * or the <code>FederationManager</code>.
048 * @see com.sun.identity.wsfederation.plugins.IDPAttributeMapper
049 *
050 * @supported.all.api
051 */
052
053public interface SPAttributeMapper {
054
055    /**
056     * Returns the map of user attribute values for the corresponding
057     * SAML <code>Attribute</code>s. This attribute value pair map will be
058     * expose by the <code>SAML</code> framework via the Single Sign On
059     * Token. 
060     * @param attributes list of SAML <code>Attribute</code>s.
061     * @param userID universal identifier or the distinguished name (DN) 
062     *        of the user. 
063     * @param hostEntityID <code>EntityID</code> of the hosted provider.  
064     * @param remoteEntityID <code>EntityID</code> of the remote provider.  
065     * @return map of <code>AttributeValuePair</code>s for the given
066     *        SAML <code>Attribute</code> list. 
067     * @exception WSFederationException if any failure.
068     */
069    public java.util.Map getAttributes(
070        java.util.List attributes,
071        java.lang.String userID,
072        java.lang.String hostEntityID,
073        java.lang.String remoteEntityID,
074        java.lang.String realm 
075    ) throws WSFederationException;
076
077
078}