diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-04-10 08:46:33 +0200 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-04-10 08:46:33 +0200 |
commit | 2d03e741a91f6155dce75952b0174e3e52a12740 (patch) | |
tree | 13c3d191bc7b27982eee51cc60ab965d20bf9392 /src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java | |
parent | c7e92047632432346c13723925f45888461887e9 (diff) | |
download | egovutils-2d03e741a91f6155dce75952b0174e3e52a12740.tar.gz egovutils-2d03e741a91f6155dce75952b0174e3e52a12740.tar.bz2 egovutils-2d03e741a91f6155dce75952b0174e3e52a12740.zip |
add PVP R-Profile authentication based HTTP headers to USP_V2 client
Diffstat (limited to 'src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java')
-rw-r--r-- | src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java b/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java index 67873f3..66fa155 100644 --- a/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java +++ b/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java @@ -36,6 +36,8 @@ import at.gv.util.ssl.JaxWsSSLConfiguration; import at.gv.util.ssl.JaxWsSSLConfigurationPropertiesImpl; import at.gv.util.xsd.szr.pvp.Param; import at.gv.util.xsd.szr.pvp.PvpTokenType; +import at.gv.util.xsd.szr.pvp.PvpTokenType.Accounting; +import at.gv.util.xsd.szr.pvp.PvpTokenType.Accounting.GvCostCenterId; import at.gv.util.xsd.szr.pvp.PvpTokenType.Authenticate; import at.gv.util.xsd.szr.pvp.PvpTokenType.Authenticate.UserPrincipal; import at.gv.util.xsd.szr.pvp.PvpTokenType.Authorize; @@ -212,12 +214,18 @@ public class EgovUtilPropertiesConfiguration implements EgovUtilConfiguration { String[] roles = roleString.split(","); + String costCenterId = props.getProperty("egovutil." + prefix + ".token.costCenterId"); + String invoiceRecptId = props.getProperty("egovutil." + prefix + ".token.invoiceRecptId"); + token.setVersion(version); - // create authentication information + // create authentication information Authenticate authenticate = new Authenticate(); authenticate.setParticipantId(participantId); authenticate.setGvOuDomain(gvOuDomain); + token.setAuthenticate(authenticate); + + //set UserPrincipal UserPrincipal up = new UserPrincipal(); up.setCn(cn); up.setGvFunction(gvFunction); @@ -226,8 +234,31 @@ public class EgovUtilPropertiesConfiguration implements EgovUtilConfiguration { up.setGvSecClass(secClass); up.setOu(ou); up.setUserId(userId); - authenticate.setUserPrincipal(up); - token.setAuthenticate(authenticate); + authenticate.setUserPrincipal(up); + + //set Accountuing information + if (MiscUtil.isNotEmpty(invoiceRecptId) || MiscUtil.isNotEmpty(costCenterId)) { + Accounting accounting = new Accounting(); + accounting.setInvoiceRecptId(invoiceRecptId); + + if (MiscUtil.isNotEmpty(costCenterId)) { + List<GvCostCenterId> gvCostCenterId = accounting.getGvCostCenterId(); + String[] costCenterIdList = costCenterId.split(","); + for (String el : costCenterIdList) { + GvCostCenterId id = new GvCostCenterId(); + id.setValue(el); + + //first element is marked as 'Default' + if (gvCostCenterId.isEmpty()) + id.setDefault(true); + gvCostCenterId.add(id); + + } + + } + token.setAccounting(accounting); + + } // set roles Authorize authorize = new Authorize(); |