2 * Licensed to the University Corporation for Advanced Internet
3 * Development, Inc. (UCAID) under one or more contributor license
4 * agreements. See the NOTICE file distributed with this work for
5 * additional information regarding copyright ownership.
7 * UCAID licenses this file to you under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except
9 * in compliance with the License. You may obtain a copy of the
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17 * either express or implied. See the License for the specific
18 * language governing permissions and limitations under the License.
22 * @file saml/saml2/profile/SAML2AssertionPolicy.h
24 * Policy subclass to track SAML 2.0 Assertion SubjectConfirmation.
27 #ifndef __saml_saml2asspol_h__
28 #define __saml_saml2asspol_h__
30 #include <saml/binding/SecurityPolicy.h>
32 #if defined (_MSC_VER)
33 #pragma warning( push )
34 #pragma warning( disable : 4250 4251 )
40 class SAML_API SubjectConfirmation;
43 * Policy subclass to track SAML 2.0 Assertion SubjectConfirmation.
45 class SAML_API SAML2AssertionPolicy : virtual public SecurityPolicy
49 * Constructor for policy.
51 * @param metadataProvider locked MetadataProvider instance
52 * @param role identifies the role (generally IdP or SP) of the policy peer
53 * @param trustEngine TrustEngine to authenticate policy peer
54 * @param validate true iff XML parsing should be done with validation
57 const saml2md::MetadataProvider* metadataProvider=nullptr,
58 const xmltooling::QName* role=nullptr,
59 const xmltooling::TrustEngine* trustEngine=nullptr,
63 virtual ~SAML2AssertionPolicy();
65 virtual void reset(bool messageOnly=false);
66 void _reset(bool messageOnly=false);
69 * Returns the subject confirmation that was successfully accepted by the policy.
71 * @return a successfully evaluated SubjectConfirmation
73 const saml2::SubjectConfirmation* getSubjectConfirmation() const;
76 * Sets the SubjectConfirmation that was successfully accepted by the policy.
78 * <p>The lifetime of the SubjectConfirmation object <strong>MUST</strong> be longer
79 * than the lifetime of the policy object.
81 * @param confirmation the successfully evaluated SubjectConfirmation
83 void setSubjectConfirmation(const saml2::SubjectConfirmation* confirmation);
86 const saml2::SubjectConfirmation* m_confirmation;
91 #if defined (_MSC_VER)
92 #pragma warning( pop )
95 #endif /* __saml_saml2asspol_h__ */