a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster/**
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * The contents of this file are subject to the terms
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of the Common Development and Distribution License
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * (the License). You may not use this file except in
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * compliance with the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * You can obtain a copy of the License at
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * opensso/legal/CDDLv1.0.txt
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * See the License for the specific language governing
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * permission and limitations under the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * When distributing Covered Code, include this CDDL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Header Notice in each file and include the License file
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * at opensso/legal/CDDLv1.0.txt.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * If applicable, add the following below the CDDL Header,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * with the fields enclosed by brackets [] replaced by
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * your own identifying information:
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * $Id: SPAttributeMapper.java,v 1.3 2008/06/25 05:47:52 qcheng Exp $
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major/**
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major * Portions Copyrighted 2014 ForgeRock AS
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterpackage com.sun.identity.saml2.plugins;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Majorimport com.sun.identity.saml2.assertion.Attribute;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterimport com.sun.identity.saml2.common.SAML2Exception;
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Majorimport java.util.List;
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Majorimport java.util.Map;
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Majorimport java.util.Set;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster/**
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This interface <code>SPAttributeMapper</code> is used to map the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * SAML <code>Attribute</code>s to the local user attributes.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This mapper will be used by the Service Provider that will read
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * the configured map for the corresponding SAML attributes and
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * supply to the SAML framework.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * The locally mapped attributes returned by the implementation of
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * this interface will be used by the SAML2 framework to expose
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * through the single sign-on token to the application.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Also, the implementation of this mapper may need to consider the deployment
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of the SAML v2 plugin base platform for example <code>AccessManager</code>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * or the <code>FederationManager</code>.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @see com.sun.identity.saml2.plugins.IDPAttributeMapper
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @supported.all.api
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterpublic interface SPAttributeMapper {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster /**
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Returns the map of user attribute values for the corresponding
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * SAML <code>Attribute</code>s. This attribute value pair map will be
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * expose by the <code>SAML</code> framework via the Single Sign On
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major * Token.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param attributes list of SAML <code>Attribute</code>s.
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major * @param userID universal identifier or the distinguished name (DN)
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major * of the user.
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major * @param hostEntityID <code>EntityID</code> of the hosted provider.
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major * @param remoteEntityID <code>EntityID</code> of the remote provider.
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major * @param realm The realm where the hosted provider belongs to.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @return map of <code>AttributeValuePair</code>s for the given
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * SAML <code>Attribute</code> list.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception SAML2Exception if any failure.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster */
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major public Map<String, Set<String>> getAttributes(
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major List<Attribute> attributes,
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major String userID,
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major String hostEntityID,
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major String remoteEntityID,
882df6887ad52745d38d9bf0d92b3ac6f7703126Peter Major String realm
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster ) throws SAML2Exception;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster}