Tidying up, removing compiler warnings etc.
This commit is contained in:
@@ -27,8 +27,8 @@ import org.springframework.security.AuthenticationException;
|
||||
*/
|
||||
public abstract class NtlmBaseException extends AuthenticationException {
|
||||
|
||||
public NtlmBaseException(final String msg) {
|
||||
super(msg);
|
||||
}
|
||||
public NtlmBaseException(final String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ package org.springframework.security.ui.ntlm;
|
||||
*/
|
||||
public class NtlmBeginHandshakeException extends NtlmBaseException {
|
||||
|
||||
public NtlmBeginHandshakeException() {
|
||||
super("NTLM");
|
||||
}
|
||||
public NtlmBeginHandshakeException() {
|
||||
super("NTLM");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -84,10 +84,10 @@ import java.util.Properties;
|
||||
public class NtlmProcessingFilter extends SpringSecurityFilter implements InitializingBean {
|
||||
//~ Static fields/initializers =====================================================================================
|
||||
|
||||
private static Log logger = LogFactory.getLog(NtlmProcessingFilter.class);
|
||||
private static Log logger = LogFactory.getLog(NtlmProcessingFilter.class);
|
||||
|
||||
private static final String STATE_ATTR = "SpringSecurityNtlm";
|
||||
private static final String CHALLENGE_ATTR = "NtlmChal";
|
||||
private static final String STATE_ATTR = "SpringSecurityNtlm";
|
||||
private static final String CHALLENGE_ATTR = "NtlmChal";
|
||||
private static final Integer BEGIN = new Integer(0);
|
||||
private static final Integer NEGOTIATE = new Integer(1);
|
||||
private static final Integer COMPLETE = new Integer(2);
|
||||
@@ -96,21 +96,21 @@ public class NtlmProcessingFilter extends SpringSecurityFilter implements Initia
|
||||
//~ Instance fields ================================================================================================
|
||||
|
||||
/** Should the filter load balance among multiple domain controllers, default <code>false</code> */
|
||||
private boolean loadBalance;
|
||||
private boolean loadBalance;
|
||||
|
||||
/** Should the domain name be stripped from the username, default <code>true</code> */
|
||||
private boolean stripDomain = true;
|
||||
|
||||
/** Should the filter initiate NTLM negotiations, default <code>true</code> */
|
||||
/** Should the filter initiate NTLM negotiations, default <code>true</code> */
|
||||
private boolean forceIdentification = true;
|
||||
|
||||
/** Should the filter retry NTLM on authorization failure, default <code>false</code> */
|
||||
private boolean retryOnAuthFailure;
|
||||
|
||||
private String soTimeout;
|
||||
private String cachePolicy;
|
||||
private String defaultDomain;
|
||||
private String domainController;
|
||||
private String soTimeout;
|
||||
private String cachePolicy;
|
||||
private String defaultDomain;
|
||||
private String domainController;
|
||||
private AuthenticationManager authenticationManager;
|
||||
private AuthenticationDetailsSource authenticationDetailsSource = new WebAuthenticationDetailsSource();
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@ public class NtlmProcessingFilterEntryPoint implements AuthenticationEntryPoint
|
||||
* @param request The {@link HttpServletRequest} object.
|
||||
* @param response Then {@link HttpServletResponse} object.
|
||||
* @param authException Either {@link NtlmBeginHandshakeException},
|
||||
* {@link NtlmType2MessageException}, or
|
||||
* {@link AuthenticationException}
|
||||
* {@link NtlmType2MessageException}, or
|
||||
* {@link AuthenticationException}
|
||||
*/
|
||||
public void commence(final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException, ServletException {
|
||||
final HttpServletResponse resp = (HttpServletResponse) response;
|
||||
|
||||
@@ -26,22 +26,22 @@ import org.springframework.security.context.SecurityContextHolder;
|
||||
*/
|
||||
public class NtlmType2MessageException extends NtlmBaseException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Authentication auth;
|
||||
private final Authentication auth;
|
||||
|
||||
public NtlmType2MessageException(final String type2Msg) {
|
||||
super("NTLM " + type2Msg);
|
||||
auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
}
|
||||
public NtlmType2MessageException(final String type2Msg) {
|
||||
super("NTLM " + type2Msg);
|
||||
auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserve the existing <code>Authentication</code> object each time
|
||||
* Internet Explorer does a POST.
|
||||
*/
|
||||
public void preserveAuthentication() {
|
||||
if (auth != null) {
|
||||
SecurityContextHolder.getContext().setAuthentication(auth);
|
||||
/**
|
||||
* Preserve the existing <code>Authentication</code> object each time
|
||||
* Internet Explorer does a POST.
|
||||
*/
|
||||
public void preserveAuthentication() {
|
||||
if (auth != null) {
|
||||
SecurityContextHolder.getContext().setAuthentication(auth);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ public class NtlmUsernamePasswordAuthenticationToken extends UsernamePasswordAut
|
||||
* Create an NTLM {@link UsernamePasswordAuthenticationToken} using the
|
||||
* JCIFS {@link NtlmPasswordAuthentication} object.
|
||||
*
|
||||
* @param ntlmAuth The {@link NtlmPasswordAuthentication} object.
|
||||
* @param stripDomain Uses just the username if <code>true</code>,
|
||||
* otherwise use the username and domain name.
|
||||
* @param ntlmAuth The {@link NtlmPasswordAuthentication} object.
|
||||
* @param stripDomain Uses just the username if <code>true</code>,
|
||||
* otherwise use the username and domain name.
|
||||
*/
|
||||
public NtlmUsernamePasswordAuthenticationToken(NtlmPasswordAuthentication ntlmAuth, boolean stripDomain) {
|
||||
super((stripDomain) ? ntlmAuth.getUsername() : ntlmAuth.getName(), DEFAULT_PASSWORD, NTLM_AUTHENTICATED);
|
||||
|
||||
Reference in New Issue
Block a user