aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
index f05866f70..6b35d7640 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
@@ -25,7 +25,11 @@ import org.opensaml.ws.message.encoder.MessageEncodingException;
import org.opensaml.xml.security.SecurityException;
import at.gv.egovernment.moa.id.MOAIDException;
+import at.gv.egovernment.moa.id.auth.AuthenticationServer;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
+import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+import at.gv.egovernment.moa.id.data.AuthenticationData;
import at.gv.egovernment.moa.id.moduls.AuthenticationManager;
import at.gv.egovernment.moa.id.protocols.pvp2x.binding.IEncoder;
import at.gv.egovernment.moa.id.protocols.pvp2x.binding.MOARequest;
@@ -95,7 +99,26 @@ public class AuthnRequestHandler implements IRequestHandler {
Subject subject = SAML2Utils.createSAMLObject(Subject.class);
NameID subjectNameID = SAML2Utils.createSAMLObject(NameID.class);
subjectNameID.setFormat(NameID.PERSISTENT);
- subjectNameID.setValue(authSession.getAuthData().getIdentificationValue());
+
+
+ //TL: AuthData generation is moved to Assertion generation.
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
+ .getOnlineApplicationParameter(authSession.getPublicOAURLPrefix());
+ boolean useUTC = oaParam.getUseUTC();
+
+ AuthenticationData authData = AuthenticationServer.buildAuthenticationData(authSession,
+ authSession.getXMLVerifySignatureResponse(),
+ useUTC,
+ authSession.isForeigner());
+
+ //TL: getIdentificationValue holds the baseID --> change to pBK
+ //subjectNameID.setValue(authData.getIdentificationValue());
+ if (authSession.getBusinessService())
+ subjectNameID.setValue(authData.getWBPK());
+ else
+ subjectNameID.setValue(authData.getBPK());
+
+
subject.setNameID(subjectNameID);
//assertion.getAttributeStatements().add(CitizenTokenBuilder.buildCitizenToken(obj, authSession));