When authentication and authorization aren't behaving the way you'd like, the first step is turning on security-related debug output. This involves editing a Log4J configuration file.
There are two general settings in log4j.xml
that can affect logging:
Threshold
param. "By setting the threshold value, only log messages matching the threshold setting or above will be logged."
<appender ...> ... <param name="Threshold" value="..."/> ... </appender> |
<root> <priority value="..." /> ... </root> |
pentaho.war/WEB-INF/classes/log4j.xml
.log4j.xml
. Remove any Threshold
param that occurs in all of the appenders (i.e. FILE
or CONSOLE
).
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"> <!-- THRESHOLD REMOVED --> </appender> <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <!-- THRESHOLD REMOVED --> </appender> |
root
logger definition. Add or change the existing priority
to WARN
, ERROR
, or FATAL
. All loggers will inherit this level except where it is overridden (which is done in the next step).
<root> <priority value="WARN" /> <appender-ref ref="CONSOLE" /> <appender-ref ref="FILE" /> </root> |
root
element. This will enable debug-level output in security-related classes.
Note: When you add
category
elements, be sure to add them before theroot
element. Otherwise, you will violate the DTD forlog4j.xml
.
<!-- all Acegi Security classes will be set to DEBUG --> <category name="org.acegisecurity"> <priority value="DEBUG" /> </category> <!-- all Pentaho security-related classes will be set to DEBUG --> <category name="com.pentaho.security"> <priority value="DEBUG" /> </category> |
pentaho-solutions/system/applicationContext-acegi-security-<back-end>.xml
where <back-end>
is one of memory
, jdbc
, or ldap
. Which one you open will depend on the type of security back-end you've configured in web.xml
. Add a property called hideUserNotFoundExceptions
with value false
to the bean with id daoAuthenticationProvider
. You're modified bean should look like the bean below. Note that existing properties and constructor-args elements for this bean should be left unmodified.
<bean id="daoAuthenticationProvider" class="authentication_provider_class_not_shown"> <!-- other properties/constructor-args not shown --> <property name="hideUserNotFoundExceptions" value="false" /> </bean> |
DEBUG [PentahoDoc:ExceptionTranslationFilter] Access is denied (user is anonymous); redirecting to authentication entry point org.acegisecurity.AccessDeniedException: Access is denied |
WARN [PentahoDoc:LoggerListener] Authentication event AuthenticationFailureBadCredentialsEvent: suzy; details: org.acegisecurity.ui.WebAuthenticationDetails@fffd148a: RemoteIpAddress: 127.0.0.1; SessionId: 976C95033136070E0200D6DA26CB0277; exception: Bad credentials |
InteractiveAuthenticationSuccessEvent
, one of the filters will show the roles fetched for the authenticated user. Compare these roles to the page-role mapping found in the filterInvocationInterceptor
bean in applicationContext-acegi-security.xml
.
WARN [PentahoDoc:LoggerListener] Authentication event InteractiveAuthenticationSuccessEvent: suzy; details: org.acegisecurity.ui.WebAuthenticationDetails@fffd148a: RemoteIpAddress: 127.0.0.1; SessionId: 976C95033136070E0200D6DA26CB0277 |
http://wiki.apache.org/logging-log4j/Log4jXmlFormat