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: IDPAccountMapper.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.saml.assertion.NameIdentifier;
033import com.sun.identity.wsfederation.common.WSFederationException;
034
035/**
036 * The interface <code>IDPAccountMapper</code> is used to map the
037 * local identities to the <code>SAML</code> protocol objects and
038 * also the vice versa for some of the protocols for e.g.
039 * <code>ManageNameIDRequest</code>.
040 * This mapper interface is used to map the identities only at the
041 * <code>SAMLAssertionProducer</code>, in otherwords, <code>SAML</code>
042 *  Provider as an <code>IdentityProvider</code>. The implementation of this
043 * interface will be used by the <code>SAML</code> framework to retrieve
044 * the user's account federation information for the constructing
045 * SAML protocol objects such as <code>Assertion</code> and also to
046 * find out the corresponding user account for the given SAML requests.
047 * The implementation of this interface may need to consider the
048 * deployment of the WS-Federation implementation for example the 
049 * <code>AccessManger</code>
050 * platform or the <code>FederationManager</code> platform.
051 * @see com.sun.identity.wsfederation.plugins.SPAccountMapper
052 *
053 * @supported.all.api
054 */
055public interface IDPAccountMapper {
056
057    /**
058     * Returns the user's <code>NameID</code>information that contains
059     * account federation with the corresponding remote and local entities.
060     * @param session Single Sign On session of the user.
061     * @param hostEntityID <code>EntityID</code> of the hosted provider.
062     * @param remoteEntityID <code>EntityID</code> of the remote provider.
063     * @return the <code>NameID</code> corresponding to the authenticated user.
064     * @exception WSFederationException if any failure.
065     */
066    public NameIdentifier getNameID(
067        Object session,
068        String realm,
069        String hostEntityID,
070        String remoteEntityID
071    ) throws WSFederationException;
072
073
074    /**
075     * Returns the user's disntinguished name or the universal ID for the
076     * corresponding  <code>SAML</code> <code>ManageNameIDRequest</code>.
077     * This method returns the universal ID or the DN based on the
078     * deployment of the SAMLv2 plugin base platform.
079     *
080     * @param manageNameIDRequest <code>SAML</code>
081     *   <code>ManageNameIDRequest</code> that needs to be mapped to the user.
082     * @param hostEntityID <code>EntityID</code> of the hosted provider.
083     * @param realm realm or the organization name that may be used to find
084     *        the user information.
085     * @return user's disntinguished name or the universal ID.
086     * @exception WSFederationException if any failure.
087     */
088    /*
089    public java.lang.String getIdentity(
090        com.sun.identity.saml2.protocol.ManageNameIDRequest manageNameIDRequest,
091        java.lang.String hostEntityID,
092        java.lang.String realm
093    ) throws WSFederationException;
094     */
095
096}