Skip to content

Commit

Permalink
Polish SunJassKrb5LoginConfig !useTicketCache
Browse files Browse the repository at this point in the history
The assertion of keyTabLocation should be independant of initializing the
keyTabLocation.
  • Loading branch information
rwinch committed May 22, 2024
1 parent be19672 commit 5e63bc6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ public void afterPropertiesSet() throws Exception {
LOG.warn("Your keytab is in the classpath. This file needs special protection and shouldn't be in the classpath. JAAS may also not be able to load this file from classpath.");
}

if (!useTicketCache || keyTabLocation != null) {
if (!useTicketCache) {
Assert.notNull(keyTabLocation, "keyTabLocation must be specified when useTicketCache is false");
}

if (keyTabLocation != null) {
keyTabLocationAsString = keyTabLocation.getURL().toExternalForm();
if (keyTabLocationAsString.startsWith("file:")) {
keyTabLocationAsString = keyTabLocationAsString.substring(5);
Expand Down

0 comments on commit 5e63bc6

Please sign in to comment.