aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/ProxyServiceAuthenticationAction.java11
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);