diff options
author | Thomas <> | 2022-10-11 18:52:20 +0200 |
---|---|---|
committer | Thomas <> | 2022-10-11 18:52:20 +0200 |
commit | 7bf30c7b020cfaa527b813085b49b86a2385d146 (patch) | |
tree | 0b7500ad054a210d4d57ffb19675c6d401b022bb /modules | |
parent | 6b93c404726457a04cb52430d40abcf23fdd8f31 (diff) | |
download | National_eIDAS_Gateway-7bf30c7b020cfaa527b813085b49b86a2385d146.tar.gz National_eIDAS_Gateway-7bf30c7b020cfaa527b813085b49b86a2385d146.tar.bz2 National_eIDAS_Gateway-7bf30c7b020cfaa527b813085b49b86a2385d146.zip |
feat(proxyservice): log warning in case of missing attributes
Diffstat (limited to 'modules')
-rw-r--r-- | modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/ProxyServiceAuthenticationAction.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/ProxyServiceAuthenticationAction.java b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/ProxyServiceAuthenticationAction.java index 7d01deda..d3c93421 100644 --- a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/ProxyServiceAuthenticationAction.java +++ b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/ProxyServiceAuthenticationAction.java @@ -239,7 +239,7 @@ public class ProxyServiceAuthenticationAction implements IAction { IEidAuthData eidAuthData) { eidasReq.getRequestedAttributes().getAttributeMap().keySet().stream() .forEach(el -> injectEidasAttribute(attributeMap, eidAuthData, - el.getNameUri().toString(), eidAuthData.isUseMandate())); + el.getNameUri().toString(), eidAuthData.isUseMandate(), el.isRequired())); } @@ -248,12 +248,12 @@ public class ProxyServiceAuthenticationAction implements IAction { ImmutableAttributeMap requestedAttributes) { attrRegistry.getRepresentativeAttributesToAddByDefault() .filter(el -> requestedAttributes.getAttributeValuesByNameUri(el) == null) - .forEach(el -> injectEidasAttribute(attributeMap, eidAuthData, el, true)); + .forEach(el -> injectEidasAttribute(attributeMap, eidAuthData, el, true, true)); } private void injectEidasAttribute(ImmutableAttributeMap.Builder attributeMap, IEidAuthData eidAuthData, - String eidasAttrName, boolean mandatesUsed) { + String eidasAttrName, boolean mandatesUsed, boolean isRequired) { final Optional<String> releatedIdaAttribute = attrRegistry.mapEidasAttributeToSpecificIdaAttribute(eidasAttrName, mandatesUsed); if (releatedIdaAttribute.isPresent()) { @@ -267,7 +267,10 @@ public class ProxyServiceAuthenticationAction implements IAction { attrRegistry.getCoreRegistry().getCoreAttributeRegistry().getByName(eidasAttrName), idaAttrValue); - } else { + } else if (isRequired) { + log.warn("eIDAS attribute: {} is marked as required, but no attribute-value available", eidasAttrName); + + } else { log.info("No IDA attribute: {}, eIDAS attribute: {} will be ignored", releatedIdaAttribute.get(), eidasAttrName); |