Skip to content
This repository has been archived by the owner on Mar 31, 2019. It is now read-only.

Commit

Permalink
Merge pull request #29 from cristal-ise/Unauthorized401
Browse files Browse the repository at this point in the history
TitusTech/webui-primeng#191: 401_Unauthorized problem: In case of BadPadd… closes #25
  • Loading branch information
kovax authored May 22, 2018
2 parents 854a1c2 + 8bd7bb3 commit 79f0f0f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/java/org/cristalise/restapi/RestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,19 @@ private synchronized AuthData decryptAuthData(String authData)
throws InvalidAgentPathException, IllegalBlockSizeException, BadPaddingException, InvalidDataException
{
byte[] bytes = DatatypeConverter.parseBase64Binary(authData);
return new AuthData(decryptCipher.doFinal(bytes));

for (int cntRetries = 1; ; cntRetries++) {
try {
return new AuthData(decryptCipher.doFinal(bytes));
}
catch (final BadPaddingException e) {
Logger.error("BadPaddingException " + cntRetries);
if (cntRetries == 5) {
throw e;
}
Logger.error(e);
}
}
}

protected synchronized String encryptAuthData(AuthData auth)
Expand Down

0 comments on commit 79f0f0f

Please # to comment.