org.springframework.security.oauth2.provider.error.LoggingOAuth2AccessDeniedHandler Maven / Gradle / Ivy
package org.springframework.security.oauth2.provider.error;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.AccessDeniedException;
public class LoggingOAuth2AccessDeniedHandler extends OAuth2AccessDeniedHandler {
@Override
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException authException) throws IOException, ServletException {
if (logger.isTraceEnabled()) {
logger.trace(authException, authException);
}
else if (logger.isWarnEnabled()) {
logger.warn(authException);
}
super.handle(request, response, authException);
}
}