package at.asitplus.eidas.specific.modules.auth.eidas.v2.handler; import java.util.HashMap; import java.util.Map; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.gv.egiz.eaaf.core.api.IRequest; import eu.eidas.auth.commons.light.impl.LightRequest.Builder; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @Slf4j public class LuEidProcessor extends AbstractEidProcessor { private static final String canHandleCC = "LU"; @Getter @Setter private int priority = 1; @Override public String getName() { return "LU-PostProcessor"; } @Override public boolean canHandle(String countryCode) { return countryCode != null && countryCode.equalsIgnoreCase(canHandleCC); } @Override protected void buildProviderNameAndRequesterIdAttribute(IRequest pendingReq, Builder authnRequestBuilder) { super.buildProviderNameAndRequesterIdAttribute(pendingReq, authnRequestBuilder); if (basicConfig.getBasicConfigurationBoolean( Constants.CONIG_PROPS_EIDAS_NODE_WORKAROUND_USE_STATIC_REQUESTERID_FOR_LUX, true)) { String staticName = basicConfig.getBasicConfiguration( Constants.CONIG_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP, Constants.DEFAULT_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP); authnRequestBuilder.providerName(staticName); authnRequestBuilder.requesterId(staticName); log.debug("Use static name: {} as 'providerName' and 'RequesterId' for all 'LU' requests ", staticName); } else { log.info("Static 'providerName' and 'RequesterId' for country: LU is deactivated"); } } @Override protected Map getCountrySpecificRequestedAttributes() { return new HashMap<>(); } }