From 41ee559d1aafc2eab6f4f9a339ff8b6ca9970c18 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 19 Jul 2018 09:35:41 +0200 Subject: change order of bPK generation strategies --- .../builder/AbstractAuthenticationDataBuilder.java | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/builder/AbstractAuthenticationDataBuilder.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/builder/AbstractAuthenticationDataBuilder.java index c095135d..ad01a796 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/builder/AbstractAuthenticationDataBuilder.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/builder/AbstractAuthenticationDataBuilder.java @@ -232,32 +232,32 @@ public abstract class AbstractAuthenticationDataBuilder implements IAuthenticati } - // baseID is in MOASesson --> calculate bPK directly - if (StringUtils.isNotEmpty(authData.getIdentificationValue())) { - log.debug("Citizen baseID is in MOASession --> calculate bPK from this."); - Pair result = buildOAspecificbPK(pendingReq, authData); - authData.setBPK(result.getFirst()); - authData.setBPKType(result.getSecond()); - - //check if bPK already added to AuthData matches OA - } else if (StringUtils.isNotEmpty(authData.getBPK()) + //check if bPK already added to AuthData matches OA + if (StringUtils.isNotEmpty(authData.getBPK()) && matchsReceivedbPKToOnlineApplication(pendingReq.getServiceProviderConfiguration(), authData.getBPKType()) ) { log.debug("Correct bPK is already included in AuthData."); - //check if bPK received by PVP-Attribute matches OA + //check if bPK received by PVP-Attribute matches OA } else if (StringUtils.isNotEmpty(pvpbPKValue) && matchsReceivedbPKToOnlineApplication(pendingReq.getServiceProviderConfiguration(), pvpbPKTypeAttr)) { log.debug("Receive correct bPK from PVP-Attribute"); authData.setBPK(pvpbPKValue); authData.setBPKType(pvpbPKTypeAttr); - - //check if decrypted bPK exists + + // baseID is in AuthSesson --> calculate bPK directly + } else if (StringUtils.isNotEmpty(authData.getIdentificationValue())) { + log.debug("Citizen baseID is in MOASession --> calculate bPK from this."); + Pair result = buildOAspecificbPK(pendingReq, authData); + authData.setBPK(result.getFirst()); + authData.setBPKType(result.getSecond()); + + //check if decrypted bPK exists } else if (pvpEncbPKAttr != null) { log.debug("Receive bPK as encrypted bPK and decryption was possible."); authData.setBPK(pvpEncbPKAttr.getFirst()); authData.setBPKType(pvpEncbPKAttr.getSecond()); - //ask SZR to get bPK + //ask SZR to get bPK } else { String notValidbPK = authData.getBPK(); String notValidbPKType = authData.getBPKType(); -- cgit v1.2.3