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: AttributeAuthorityMapper.java,v 1.3 2008/12/03 00:34:10 hengming Exp $
026 *
027 */
028
029package com.sun.identity.saml2.plugins;
030
031import java.util.List;
032import javax.servlet.http.HttpServletRequest;
033import javax.servlet.http.HttpServletResponse;
034
035import com.sun.identity.saml2.common.SAML2Exception;
036import com.sun.identity.saml2.protocol.AttributeQuery;
037
038/**
039 * This interface <code>AttributeAuthorityMapper</code> is used by attribute
040 * authority to process attribute query. Make sure to use thread-safe code if 
041 * you implement the AttributeAuthorityMapper. You can use the attributes on 
042 * the HttpRequest instead of synchronizing them. The default 
043 * AttributeAuthorityMapper uses an attribute on the HttpServletRequest to
044 * pass information to the AttributeQueryUtil.
045 *
046 * @supported.all.api
047 */ 
048public interface AttributeAuthorityMapper {
049
050    /**
051     * Checks if the attribute query requester is valid.
052     *
053     * @param request HttpServletRequest
054     * @param response HttpServletResponse
055     * @param attrQuery attribute query
056     * @param attrAuthorityEntityID entity ID of attribute authority
057     * @param realm the realm of hosted entity
058     *
059     * @exception SAML2Exception if the request is not valid. 
060     */
061    public void authenticateRequester(HttpServletRequest request,
062        HttpServletResponse response, AttributeQuery attrQuery,
063        String attrAuthorityEntityID, String realm) throws SAML2Exception;
064
065    /**
066     * Checks if the attribute query is valid.
067     *
068     * @param request HttpServletRequest
069     * @param response HttpServletResponse
070     * @param attrQuery attribute query
071     * @param attrAuthorityEntityID entity ID of attribute authority
072     * @param realm the realm of hosted entity
073     *
074     * @exception SAML2Exception if the attribute query is not valid. 
075     */
076    public void validateAttributeQuery(HttpServletRequest request,
077        HttpServletResponse response, AttributeQuery attrQuery,
078        String attrAuthorityEntityID, String realm) throws SAML2Exception;
079
080    /**
081     * Returns an identity that matches the subject in the attribute query.
082     *
083     * @param request HttpServletRequest
084     * @param response HttpServletResponse
085     * @param attrQuery attribute query
086     * @param attrAuthorityEntityID entity ID of attribute authority
087     * @param realm the realm of hosted entity
088     * @return an identity that matches the subject in the attribute query.
089     *
090     * @exception SAML2Exception if error occurs. 
091     */
092    public Object getIdentity(HttpServletRequest request,
093        HttpServletResponse response, AttributeQuery attrQuery,
094        String attrAuthorityEntityID, String realm) throws SAML2Exception;
095
096    /**
097     * Returns attributes of the specifed identity.
098     *
099     * @param identity the identity
100     * @param attrQuery attribute query
101     * @param attrAuthorityEntityID entity ID of attribute authority
102     * @param realm the realm of hosted entity
103     * @return a list of
104     *     <code>com.sun.identity.saml2.assertion.Attribute</code>.
105     *
106     * @exception SAML2Exception if error occurs. 
107     */
108    public List getAttributes(Object identity, AttributeQuery attrQuery,
109        String attrAuthorityEntityID, String realm) throws SAML2Exception;
110
111}




























































Copyright © 2010-2017, ForgeRock All Rights Reserved.