diff options
author | Thomas <> | 2023-08-31 20:37:42 +0200 |
---|---|---|
committer | Thomas <> | 2023-08-31 20:37:42 +0200 |
commit | e915685e22c7c084f7fd0c4870ff20d3f0194a91 (patch) | |
tree | 638deef490a63799ff48ca826ff8702b2efbee2a /eaaf_modules/eaaf_module_pvp2_sp/src | |
parent | 5acc09000c59c93510567e88cb701919122dc5b2 (diff) | |
download | EAAF-Components-e915685e22c7c084f7fd0c4870ff20d3f0194a91.tar.gz EAAF-Components-e915685e22c7c084f7fd0c4870ff20d3f0194a91.tar.bz2 EAAF-Components-e915685e22c7c084f7fd0c4870ff20d3f0194a91.zip |
feat(core): refactor to openSAML 5 for Java 17
Diffstat (limited to 'eaaf_modules/eaaf_module_pvp2_sp/src')
2 files changed, 7 insertions, 15 deletions
diff --git a/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/PvpAuthnRequestBuilder.java b/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/PvpAuthnRequestBuilder.java index bac90451..13a9cc7a 100644 --- a/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/PvpAuthnRequestBuilder.java +++ b/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/PvpAuthnRequestBuilder.java @@ -23,8 +23,6 @@ import java.security.NoSuchAlgorithmException; import java.time.Instant; import java.util.List; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.lang3.StringUtils; import org.opensaml.messaging.encoder.MessageEncodingException; import org.opensaml.saml.common.xml.SAMLConstants; @@ -60,7 +58,8 @@ import at.gv.egiz.eaaf.modules.pvp2.impl.builder.reqattr.EaafRequestExtensionBui import at.gv.egiz.eaaf.modules.pvp2.impl.utils.Saml2Utils; import at.gv.egiz.eaaf.modules.pvp2.sp.api.IPvpAuthnRequestBuilderConfiguruation; import at.gv.egiz.eaaf.modules.pvp2.sp.exception.AuthnRequestBuildException; -import net.shibboleth.utilities.java.support.security.impl.SecureRandomIdentifierGenerationStrategy; +import jakarta.servlet.http.HttpServletResponse; +import net.shibboleth.shared.security.impl.SecureRandomIdentifierGenerationStrategy; /** * PVP2 S-Profil Authentication-Request builder-implementation. 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 4d8c8993..71421aae 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 @@ -316,13 +316,8 @@ public class AssertionAttributeExtractor { * @return Date, when the SAML2 assertion was issued, otherwise null */ public Instant getAssertionIssuingDate() { - try { - return getFullAssertion().getIssueInstant(); + return getFullAssertion() != null ? getFullAssertion().getIssueInstant() : null; - } catch (final NullPointerException e) { - return null; - - } } /** @@ -335,13 +330,11 @@ public class AssertionAttributeExtractor { * @return Date, after this SAML2 assertion is valid, otherwise null */ public Date getAssertionNotBefore() { - try { - return Date.from(getFullAssertion().getConditions().getNotBefore()); + return getFullAssertion() != null && getFullAssertion().getConditions() != null + && getFullAssertion().getConditions().getNotBefore() != null + ? Date.from(getFullAssertion().getConditions().getNotBefore()) + : null; - } catch (final NullPointerException e) { - return null; - - } } private AuthnStatement getAuthnStatement() throws AssertionAttributeExtractorExeption { |