If the auth-token-file parameter in the file application.yaml is missing, it would not default to an empty file name.
Issue-ID: CCSDK-3683
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Change-Id: I6957762ac0df2c159a8273f3bf161b1a68ab85e7
@Setter
private Path authTokenFilePath;
- public SecurityContext(@Value("${app.auth-token-file:\"\"}") String authTokenFilename) {
+ public SecurityContext(@Value("${app.auth-token-file:}") String authTokenFilename) {
if (!authTokenFilename.isEmpty()) {
this.authTokenFilePath = Path.of(authTokenFilename);
}
}
try {
long lastModified = authTokenFilePath.toFile().lastModified();
- if (lastModified != this.tokenTimestamp) {
+ if (tokenTimestamp == 0 || lastModified != this.tokenTimestamp) {
this.authToken = Files.readString(authTokenFilePath);
this.tokenTimestamp = lastModified;
}