001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyrighted [year] [name of copyright owner]".
013 *
014 * Copyright 2014-2016 ForgeRock AS. All rights reserved.
015 */
016
017package org.forgerock.openam.sts.tokengeneration.saml2.statements;
018
019import com.sun.identity.saml2.assertion.AuthnStatement;
020import org.forgerock.openam.sts.TokenCreationException;
021import org.forgerock.openam.sts.config.user.SAML2Config;
022
023import java.util.List;
024
025/**
026 * Defines the concern of providing the AuthnStatement list to be included in the generated SAML2 assertion. If no
027 * custom interface implementation is specified in the SAML2Config, then the DefaultAuthenticationStatementsProvider will
028 * be used.
029 *
030 * @supported.all.api
031 */
032public interface AuthenticationStatementsProvider {
033
034    /**
035     * Invoked to obtain the List of AuthnStatement instances to be included in the generated SAML2 assertion.
036     *
037     * @param saml2Config The STS-instance-specific SAML2 configurations
038     * @param authnContextClassRef The AuthNContext class ref pulled out of the TokenGenerationServiceInvocationState.
039     * @return The list of AuthnStatements
040     * @throws TokenCreationException
041     */
042    List<AuthnStatement> get(SAML2Config saml2Config, String authnContextClassRef) throws TokenCreationException;
043}