aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java22
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java4
3 files changed, 16 insertions, 12 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
index 093d22732..bf35b31f2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
@@ -1679,6 +1679,8 @@ public class AuthenticationServer implements MOAIDAuthConstants {
if (isPrPerson.equalsIgnoreCase("pr:PhysicalPerson")) {
Node prIdentification = mandatePerson.getFirstChild();
prIdentification.getFirstChild().setTextContent("");
+// Element.appendChild(Document.createTextNode(String));
+// prIdentification.getFirstChild().
}
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java
index 145664a2b..6a78df9b2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java
@@ -74,13 +74,21 @@ public class SAMLArtifactBuilder {
// alternative sourceId
String alternativeSourceID = AuthConfigurationProvider.getInstance().getGenericConfigurationParameter(GENERIC_CONFIG_PARAM_SOURCEID);
- //System.out.println("alternativeSourceID: " + alternativeSourceID);
- //System.out.println("authURL: " + authURL);
-
// if sourceID is given in GET/POST param - use this as source id
if (!ParepUtils.isEmpty(sourceIdParam)) {
// if GET/POST parameter sourceID is set, use that sourceID instead of authURL;
- sourceID = md.digest(sourceIdParam.getBytes());
+ //sourceID = md.digest(sourceIdParam.getBytes());
+
+ // if sourceIdParam is too short (must have 20 characters) - add " "
+ int length = sourceIdParam.length();
+ if (length < 20) {
+ int l = 20 - length;
+ for (int i = 0; i < l; i++) {
+ sourceIdParam += " ";
+ }
+ }
+
+ sourceID = sourceIdParam.getBytes();
Logger.info("Building SAMArtifact from sourceID \"" + sourceIdParam + "\" instead of authURL \"" + authURL + "\".");
byte[] assertionHandle = md.digest(sessionID.getBytes());
@@ -90,9 +98,7 @@ public class SAMLArtifactBuilder {
out.write(sourceID, 0, 20);
out.write(assertionHandle, 0, 20);
byte[] samlArtifact = out.toByteArray();
- //System.out.println("samlArtifact: " + new String(samlArtifact));
String samlArtifactBase64 = Base64Utils.encode(samlArtifact);
- //System.out.println("samlArtifact Base64: " + samlArtifactBase64);
return samlArtifactBase64;
}
@@ -108,9 +114,7 @@ public class SAMLArtifactBuilder {
out.write(sourceID, 0, 20);
out.write(assertionHandle, 0, 20);
byte[] samlArtifact = out.toByteArray();
- System.out.println("samlArtifact: " + new String(samlArtifact));
String samlArtifactBase64 = Base64Utils.encode(samlArtifact);
- System.out.println("samlArtifact Base64: " + samlArtifactBase64);
return samlArtifactBase64;
}
@@ -123,9 +127,7 @@ public class SAMLArtifactBuilder {
out.write(sourceID, 0, 20);
out.write(assertionHandle, 0, 20);
byte[] samlArtifact = out.toByteArray();
- //System.out.println("samlArtifact: " + new String(samlArtifact));
String samlArtifactBase64 = Base64Utils.encode(samlArtifact);
- //System.out.println("samlArtifact Base64: " + samlArtifactBase64);
return samlArtifactBase64;
//System.out.println("sourceID: " + new String(sourceID));
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
index 644e59f72..9df55724e 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
@@ -94,7 +94,7 @@ public class ParamValidatorUtils {
}
- Pattern pattern = Pattern.compile("[\\w-_]{1,50}");
+ Pattern pattern = Pattern.compile("[\\w-_]{1,20}");
Matcher matcher = pattern.matcher(sourceID);
boolean b = matcher.matches();
if (b) {
@@ -102,7 +102,7 @@ public class ParamValidatorUtils {
return true;
}
else {
- Logger.error("Fehler Überprüfung Parameter sourceID. SourceID entspricht nicht den Kriterien (nur Zeichen a-z, A-Z, - und _, sowie 1-50 Zeichen lang)");
+ Logger.error("Fehler Überprüfung Parameter sourceID. SourceID entspricht nicht den Kriterien (nur Zeichen a-z, A-Z, - und _, sowie 1-20 Zeichen lang)");
return false;
}