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/** 030 * Portions Copyrighted 2014 ForgeRock AS 031 */ 032package com.sun.identity.saml2.plugins; 033 034import com.sun.identity.saml2.assertion.Attribute; 035import com.sun.identity.saml2.common.SAML2Exception; 036import java.util.List; 037import java.util.Map; 038import java.util.Set; 039 040 041/** 042 * This interface <code>SPAttributeMapper</code> is used to map the 043 * SAML <code>Attribute</code>s to the local user attributes. 044 * This mapper will be used by the Service Provider that will read 045 * the configured map for the corresponding SAML attributes and 046 * supply to the SAML framework. 047 * The locally mapped attributes returned by the implementation of 048 * this interface will be used by the SAML2 framework to expose 049 * through the single sign-on token to the application. 050 * Also, the implementation of this mapper may need to consider the deployment 051 * of the SAML v2 plugin base platform for example <code>AccessManager</code> 052 * or the <code>FederationManager</code>. 053 * @see com.sun.identity.saml2.plugins.IDPAttributeMapper 054 * 055 * @supported.all.api 056 */ 057 058public interface SPAttributeMapper { 059 060 /** 061 * Returns the map of user attribute values for the corresponding 062 * SAML <code>Attribute</code>s. This attribute value pair map will be 063 * expose by the <code>SAML</code> framework via the Single Sign On 064 * Token. 065 * @param attributes list of SAML <code>Attribute</code>s. 066 * @param userID universal identifier or the distinguished name (DN) 067 * of the user. 068 * @param hostEntityID <code>EntityID</code> of the hosted provider. 069 * @param remoteEntityID <code>EntityID</code> of the remote provider. 070 * @param realm The realm where the hosted provider belongs to. 071 * @return map of <code>AttributeValuePair</code>s for the given 072 * SAML <code>Attribute</code> list. 073 * @exception SAML2Exception if any failure. 074 */ 075 public Map<String, Set<String>> getAttributes( 076 List<Attribute> attributes, 077 String userID, 078 String hostEntityID, 079 String remoteEntityID, 080 String realm 081 ) throws SAML2Exception; 082 083 084}