Skip to content

Commit

Permalink
Small fix to allow JAAS based security when hawtio is used within an …
Browse files Browse the repository at this point in the history
…OSGi container and an embedded Jetty i.e. within pax-web-jetty.
  • Loading branch information
atooni committed Oct 5, 2013
1 parent daa48ef commit 7cdc20f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions hawtio-web/pom.xml
Expand Up @@ -342,6 +342,8 @@

<!-- fix jgit, and slf4j imports -->
<Import-Package>
org.eclipse.jetty.plus.jaas.spi;resolution:=optional,
org.eclipse.jetty.plus.jaas.callback;resolution:=optional,
org.apache.commons.logging;resolution:=optional,
org.slf4j;resolution:=optional,
!org.slf4j.impl,
Expand Down
6 changes: 4 additions & 2 deletions hawtio-web/src/main/java/io/hawt/system/Authenticator.java
Expand Up @@ -104,8 +104,10 @@ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallback
if (callback instanceof NameCallback) {
((NameCallback)callback).setName(username);
} else if (callback instanceof PasswordCallback) {
((PasswordCallback)callback).setPassword(password.toCharArray()); } else {
throw new UnsupportedCallbackException(callback);
((PasswordCallback)callback).setPassword(password.toCharArray());
} else {
LOG.warn("Unsupported callback class [" + callback.getClass().getName() + "]");
// throw new UnsupportedCallbackException(callback);
}
}
}
Expand Down

0 comments on commit 7cdc20f

Please sign in to comment.