brusdev commented on code in PR #4461:
URL: https://github.com/apache/activemq-artemis/pull/4461#discussion_r1185981084


##########
artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java:
##########
@@ -141,8 +141,9 @@ private Subject getAuthenticatedSubject(final String user,
          try {
             lc.login();
          } catch (LoginException e) {
-            Throwable rootCause = ExceptionUtil.getRootCause(e);
+            Throwable rootCause = ExceptionUtils.getRootCause(e);
             if (rootCause instanceof NoCacheLoginException) {
+               logger.debug("Handling LoginException with 
NoCacheLoginException root cause", e);

Review Comment:
   @jbertram thanks for pointing me to the reason of the current 
implementation. If I understand correctly JAAS converts NoCacheLoginException 
into LoginException because NoCacheLoginException is not a subclass of 
LoginException.
   
   If NoCacheLoginException would inherit from LoginException and 
ActiveMQSecurityManager5.authenticate would throw LoginException we could avoid 
to set and check the root cause, we could just throw and catch 
NoCacheLoginException. Is that right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to