aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2015-05-05 16:35:38 +0200
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2015-05-05 16:35:38 +0200
commitb110b9d1acd557e103ea4afc88499f2271d4c855 (patch)
tree29bb4335e18dfad64a22340876615733877fbf20 /id/server/idserverlib
parentb4e8abf78acf92e6a40606ddd02d381e73a0d487 (diff)
downloadmoa-id-spss-b110b9d1acd557e103ea4afc88499f2271d4c855.tar.gz
moa-id-spss-b110b9d1acd557e103ea4afc88499f2271d4c855.tar.bz2
moa-id-spss-b110b9d1acd557e103ea4afc88499f2271d4c855.zip
fix: gather any attribute from STORK2 response first if available
Diffstat (limited to 'id/server/idserverlib')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java
index d3a5a1085..3b2fae0d5 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java
@@ -79,7 +79,17 @@ public class MOAAttributeProvider {
public void populateAttribute(PersonalAttributeList attributeList, PersonalAttribute requestedAttribute ) {
String storkAttribute = requestedAttribute.getName();
- if (storkAttributeSimpleMapping.containsKey(storkAttribute)) {
+ if (authData.getStorkAttributes().containsKey(requestedAttribute.getName())) {
+ Logger.debug("Trying to get value for attribute directly from STORK2 response [" + storkAttribute + "]");
+ try {
+ PersonalAttribute tmp = authData.getStorkAttributes().get(requestedAttribute.getName());
+ attributeList.add((PersonalAttribute) tmp.clone());
+ } catch(Exception e) {
+ Logger.error("Could not retrieve attribute from STORK2 response: " + storkAttribute);
+ if(Logger.isDebugEnabled())
+ e.printStackTrace();
+ }
+ } else if (storkAttributeSimpleMapping.containsKey(storkAttribute)) {
Logger.debug("Trying to get value for attribute using simple mapping [" + storkAttribute + "]");
try {
Method method = authData.getClass().getDeclaredMethod(storkAttributeSimpleMapping.get(storkAttribute));
@@ -99,16 +109,6 @@ public class MOAAttributeProvider {
Logger.error("Could not found MOA extraction method while getting attribute: " + storkAttribute);
e.printStackTrace();
}
- } else if (authData.getStorkAttributes().containsKey(requestedAttribute.getName())) {
- Logger.debug("Trying to get value for attribute directly from STORK2 response [" + storkAttribute + "]");
- try {
- PersonalAttribute tmp = authData.getStorkAttributes().get(requestedAttribute.getName());
- attributeList.add((PersonalAttribute) tmp.clone());
- } catch(Exception e) {
- Logger.error("Could not retrieve attribute from STORK2 response: " + storkAttribute);
- if(Logger.isDebugEnabled())
- e.printStackTrace();
- }
} else {
Logger.debug("MOA method for extraction of attribute " + storkAttribute + " not defined.");
}