aboutsummaryrefslogtreecommitdiff
path: root/modules/eidas_proxy-sevice/src
diff options
context:
space:
mode:
authorThomas <>2023-12-11 08:42:56 +0100
committerThomas <>2023-12-11 08:42:56 +0100
commit5ae4de61ce280fc3abd477b4fba41777544558ad (patch)
tree19c72203fe019e671a3f156fee26e362e41bb282 /modules/eidas_proxy-sevice/src
parent275df4bcfba3d078b77776ac9767b3e30de8e59a (diff)
downloadNational_eIDAS_Gateway-5ae4de61ce280fc3abd477b4fba41777544558ad.tar.gz
National_eIDAS_Gateway-5ae4de61ce280fc3abd477b4fba41777544558ad.tar.bz2
National_eIDAS_Gateway-5ae4de61ce280fc3abd477b4fba41777544558ad.zip
chore(proxyservice): write attribute names into log before forward to eIDAS node
Diffstat (limited to 'modules/eidas_proxy-sevice/src')
-rw-r--r--modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/ProxyServiceAuthenticationAction.java21
1 files changed, 19 insertions, 2 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 f3dcb968..fe7c7d7f 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
@@ -1,6 +1,7 @@
package at.asitplus.eidas.specific.modules.msproxyservice.protocol;
import java.io.IOException;
+import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
@@ -103,7 +104,7 @@ public class ProxyServiceAuthenticationAction implements IAction {
lightRespBuilder.levelOfAssurance(authData.getEidasQaaLevel());
lightRespBuilder.attributes(eidasAttributes);
-
+
// set SLO response object of EAAF framework
final SloInformationImpl sloInformation = new SloInformationImpl();
sloInformation.setProtocolType(pendingReq.requestedModule());
@@ -111,7 +112,9 @@ public class ProxyServiceAuthenticationAction implements IAction {
.setSpEntityID(pendingReq.getServiceProviderConfiguration().getUniqueIdentifier());
// forward to eIDAS Proxy-Service
- forwardToEidasProxy(pendingReq, httpReq, httpResp, lightRespBuilder.build());
+ LightResponse eidasResp = lightRespBuilder.build();
+ logProvidedAttributes(eidasResp);
+ forwardToEidasProxy(pendingReq, httpReq, httpResp, eidasResp);
return sloInformation;
@@ -129,6 +132,19 @@ public class ProxyServiceAuthenticationAction implements IAction {
}
+ private void logProvidedAttributes(LightResponse eidasResp) {
+ if (eidasResp.getAttributes() == null && eidasResp.getAttributes().isEmpty()) {
+ log.warn("Transfer no attributes to eIDAS Node. There is something wrong");
+
+ } else {
+ List<String> listOfAllAttributeNames = eidasResp.getAttributes().getDefinitions().stream()
+ .map(el -> el.getFriendlyName())
+ .collect(Collectors.toList());
+ log.info("Transfer attributes to eIDAS Node: {}", StringUtils.join(listOfAllAttributeNames, ","));
+
+ }
+ }
+
@Override
public boolean needAuthentication(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp) {
return true;
@@ -173,6 +189,7 @@ public class ProxyServiceAuthenticationAction implements IAction {
new Object[] { MsProxyServiceConstants.CONIG_PROPS_EIDAS_PROXY_NODE_FORWARD_URL });
}
+
log.debug("ForwardURL: " + forwardUrl + " selected to forward eIDAS request");
if (basicConfig.getBasicConfiguration(