karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r964695 - in /karaf/trunk/webconsole/branding: pom.xml src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java
Date Fri, 16 Jul 2010 06:59:39 GMT
Author: gnodet
Date: Fri Jul 16 06:59:39 2010
New Revision: 964695

URL: http://svn.apache.org/viewvc?rev=964695&view=rev
Log:
KARAF-121: Better exception handling in JaasSecurityProvider

Modified:
    karaf/trunk/webconsole/branding/pom.xml
    karaf/trunk/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java

Modified: karaf/trunk/webconsole/branding/pom.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/branding/pom.xml?rev=964695&r1=964694&r2=964695&view=diff
==============================================================================
--- karaf/trunk/webconsole/branding/pom.xml (original)
+++ karaf/trunk/webconsole/branding/pom.xml Fri Jul 16 06:59:39 2010
@@ -47,6 +47,11 @@
           <artifactId>org.apache.felix.webconsole</artifactId>
           <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: karaf/trunk/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java
URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java?rev=964695&r1=964694&r2=964695&view=diff
==============================================================================
--- karaf/trunk/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java
(original)
+++ karaf/trunk/webconsole/branding/src/main/java/org/apache/karaf/webconsole/JaasSecurityProvider.java
Fri Jul 16 06:59:39 2010
@@ -17,18 +17,26 @@
 package org.apache.karaf.webconsole;
 
 import java.io.IOException;
+import java.security.GeneralSecurityException;
+
 import javax.security.auth.Subject;
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.AccountException;
+import javax.security.auth.login.FailedLoginException;
 import javax.security.auth.login.LoginContext;
 
 import org.apache.felix.webconsole.WebConsoleSecurityProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class JaasSecurityProvider implements WebConsoleSecurityProvider {
 
+	private static final Logger LOG = LoggerFactory.getLogger(WebConsoleSecurityProvider.class);
+
     private String realm;
 
     public String getRealm() {
@@ -57,7 +65,14 @@ public class JaasSecurityProvider implem
             });
             loginContext.login();
             return subject;
-        } catch (Exception e) {
+        } catch (FailedLoginException e) {
+            LOG.debug("Login failed", e);
+            return null;
+        } catch (AccountException e) {
+            LOG.warn("Account failure", e);
+            return null;
+        } catch (GeneralSecurityException e) {
+            LOG.error("General Security Exception", e);
             return null;
         }
     }



Mime
View raw message