diff options
Diffstat (limited to 'eaaf_modules/eaaf_module_pvp2_sp/src/main')
-rw-r--r-- | eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java b/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java index 53d9d9e8..b12a5913 100644 --- a/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java +++ b/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import at.gv.egiz.eaaf.core.api.data.ExtendedPvpAttributeDefinitions; import at.gv.egiz.eaaf.modules.pvp2.PvpConstants; import at.gv.egiz.eaaf.modules.pvp2.sp.exception.AssertionAttributeExtractorExeption; @@ -52,14 +53,19 @@ public class AssertionAttributeExtractor { private final Map<String, List<String>> attributs = new HashMap<>(); // private PersonalAttributeList storkAttributes = new PersonalAttributeList(); + @Deprecated private final List<String> minimalMdsAttributeNamesList = Arrays.asList(PvpConstants.PRINCIPAL_NAME_NAME, PvpConstants.GIVEN_NAME_NAME, PvpConstants.BIRTHDATE_NAME, PvpConstants.BPK_NAME); + @Deprecated private final List<String> minimalIdlAttributeNamesList = Arrays.asList(PvpConstants.EID_IDENTITY_LINK_NAME, PvpConstants.EID_SOURCE_PIN_NAME, PvpConstants.EID_SOURCE_PIN_TYPE_NAME); + private final List<String> minimalEidAttributeNamesList = + Arrays.asList(ExtendedPvpAttributeDefinitions.EID_EIDBIND_NAME); + /** * Parse the SAML2 Response element and extracts included information. <br> * <br> @@ -128,8 +134,9 @@ public class AssertionAttributeExtractor { * @return */ public boolean containsAllRequiredAttributes() { - return containsAllRequiredAttributes(minimalMdsAttributeNamesList) - || containsAllRequiredAttributes(minimalIdlAttributeNamesList); + return containsAllRequiredAttributes(minimalEidAttributeNamesList) + || containsAllRequiredAttributes(minimalIdlAttributeNamesList) + || containsAllRequiredAttributes(minimalMdsAttributeNamesList); } @@ -300,6 +307,25 @@ public class AssertionAttributeExtractor { } /** + * Get the Assertion issuing date. + * + * <p> + * This method returns value of SAML 'Conditions' element. + * </p> + * + * @return Date, when the SAML2 assertion was issued, otherwise null + */ + public Date getAssertionIssuingDate() { + try { + return getFullAssertion().getIssueInstant().toDate(); + + } catch (final NullPointerException e) { + return null; + + } + } + + /** * Get the Assertion validFrom period. * * <p> @@ -316,7 +342,6 @@ public class AssertionAttributeExtractor { return null; } - } private AuthnStatement getAuthnStatement() throws AssertionAttributeExtractorExeption { |