From f77f1a4ec8766550641cf6079d08c724f9cf15f5 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Sun, 22 Jun 2014 05:17:37 +0200 Subject: spcountry workaround --- id/id.iml | 13 +++++ id/oa/moa-id-oa.iml | 64 ++++++++++++++++++++++ .../MandateAttributeRequestProvider.java | 18 ++++++ 3 files changed, 95 insertions(+) create mode 100644 id/id.iml create mode 100644 id/oa/moa-id-oa.iml (limited to 'id') diff --git a/id/id.iml b/id/id.iml new file mode 100644 index 000000000..c418d6693 --- /dev/null +++ b/id/id.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/id/oa/moa-id-oa.iml b/id/oa/moa-id-oa.iml new file mode 100644 index 000000000..b2663c565 --- /dev/null +++ b/id/oa/moa-id-oa.iml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/MandateAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/MandateAttributeRequestProvider.java index cd9042342..8df3c00aa 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/MandateAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/MandateAttributeRequestProvider.java @@ -127,6 +127,24 @@ public class MandateAttributeRequestProvider extends AttributeProvider { String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName(); String spApplication = spInstitution; + if ((spCountryCode == null) || (spCountryCode.length()<2)) { + spCountryCode = oaParam.getTarget(); + Logger.info("Setting spcountry target: " + oaParam.getTarget()); + Logger.info("idlink ident " + oaParam.getIdentityLinkDomainIdentifier()); + Logger.info("idlink type " + oaParam.getIdentityLinkDomainIdentifierType()); + Logger.info("Setting spcountry target friendly : " + oaParam.getTargetFriendlyName()); + Logger.info("Oatype : " + oaParam.getOaType()); + Logger.info("puburl : " + oaParam.getPublicURLPrefix()); + if ("STORK".equals(oaParam.getIdentityLinkDomainIdentifierType())) { + + spCountryCode = oaParam.getIdentityLinkDomainIdentifier().substring(oaParam.getIdentityLinkDomainIdentifier().length()-2); + Logger.info("Set to " +spCountryCode); + } + + } + + + //generate AttrQueryRequest STORKAttrQueryRequest attributeRequest = new STORKAttrQueryRequest(); attributeRequest.setDestination(destination); -- cgit v1.2.3