Updated OAuth2 token length & secure random algorithm config.
Change-Id: I1c0cd2d7ad6e7c3e5570fae19fa86211a01bfeff
diff --git a/core/Changes b/core/Changes
index 7d3e66f..c1b2d80 100644
--- a/core/Changes
+++ b/core/Changes
@@ -1,3 +1,7 @@
+# version 0.63.2
+2021-06-11
+ - Updated OAuth2 token length & secure random algorithm config.
+
# version 0.63.1
2021-03-25
- Updated Koral version for InfoController.
diff --git a/core/pom.xml b/core/pom.xml
index 2abe824..aea6ed4 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.ids_mannheim.korap</groupId>
<artifactId>Kustvakt-core</artifactId>
- <version>0.63.1</version>
+ <version>0.63.2</version>
<properties>
<java.version>1.8</java.version>
diff --git a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 913da7b..eba39a5 100644
--- a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -122,7 +122,7 @@
port = new Integer(properties.getProperty("server.port", "8095"));
baseURL = properties.getProperty("kustvakt.base.url", "/api/*");
setSecureRandomAlgorithm(properties
- .getProperty("security.secure.random.algorithm", "SHA1PRNG"));
+ .getProperty("security.secure.random.algorithm", ""));
setMessageDigestAlgorithm(
properties.getProperty("security.md.algorithm", "MD5"));
}
diff --git a/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java b/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
index ea451aa..fe23f22 100644
--- a/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
+++ b/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
@@ -33,8 +33,15 @@
@PostConstruct
public void init () throws NoSuchAlgorithmException {
- secureRandom =
- SecureRandom.getInstance(config.getSecureRandomAlgorithm());
+ String algorithm = config.getSecureRandomAlgorithm();
+ if (!algorithm.isEmpty()) {
+ secureRandom =
+ SecureRandom.getInstance(algorithm);
+ }
+ else {
+ secureRandom = new SecureRandom();
+ }
+ System.out.println("Secure random algorithm: "+secureRandom.getAlgorithm());
}
public String createRandomCode (KustvaktConfiguration c)