mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-24 04:52:16 +00:00
Refactored to use Spring Assert class. Corrected some typos.
This commit is contained in:
parent
3d4f8eed31
commit
f2788c7cb6
@ -40,6 +40,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
* <P>
|
* <P>
|
||||||
* For a detailed background on what this filter is designed to process, refer
|
* For a detailed background on what this filter is designed to process, refer
|
||||||
* to <A HREF="http://www.ietf.org/rfc/rfc2617.txt">RFC 2617</A> (which
|
* to <A HREF="http://www.ietf.org/rfc/rfc2617.txt">RFC 2617</A> (which
|
||||||
* superseeded RFC 2069, although this filter support clients that implement
|
* superseded RFC 2069, although this filter support clients that implement
|
||||||
* either RFC 2617 or RFC 2069).
|
* either RFC 2617 or RFC 2069).
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
@ -138,15 +139,8 @@ public class DigestProcessingFilter implements Filter, InitializingBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() throws Exception {
|
||||||
if (this.authenticationDao == null) {
|
Assert.notNull(authenticationDao, "An AuthenticationDao is required");
|
||||||
throw new IllegalArgumentException(
|
Assert.notNull(authenticationEntryPoint, "A DigestProcessingFilterEntryPoint is required");
|
||||||
"An AuthenticationDao is required");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.authenticationEntryPoint == null) {
|
|
||||||
throw new IllegalArgumentException(
|
|
||||||
"A DigestProcessingFilterEntryPoint is required");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {}
|
public void destroy() {}
|
||||||
@ -237,7 +231,7 @@ public class DigestProcessingFilter implements Filter, InitializingBean {
|
|||||||
if (!Base64.isArrayByteBase64(nonce.getBytes())) {
|
if (!Base64.isArrayByteBase64(nonce.getBytes())) {
|
||||||
fail(request, response,
|
fail(request, response,
|
||||||
new BadCredentialsException(
|
new BadCredentialsException(
|
||||||
"None is not encoded in Base64; received nonce: '"
|
"Nonce is not encoded in Base64; received nonce: '"
|
||||||
+ nonce + "'"));
|
+ nonce + "'"));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -392,7 +386,7 @@ public class DigestProcessingFilter implements Filter, InitializingBean {
|
|||||||
* Computes the <code>response</code> portion of a Digest authentication
|
* Computes the <code>response</code> portion of a Digest authentication
|
||||||
* header. Both the server and user agent should compute the
|
* header. Both the server and user agent should compute the
|
||||||
* <code>response</code> independently. Provided as a static method to
|
* <code>response</code> independently. Provided as a static method to
|
||||||
* simply the coding of user agents.
|
* simplify the coding of user agents.
|
||||||
*
|
*
|
||||||
* @param username DOCUMENT ME!
|
* @param username DOCUMENT ME!
|
||||||
* @param realm DOCUMENT ME!
|
* @param realm DOCUMENT ME!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user