SEC-690: Use consistent naming in OpenID classes

http://jira.springframework.org/browse/SEC-690
This commit is contained in:
Luke Taylor 2008-02-29 12:52:13 +00:00
parent 45e43073a0
commit 5ba7091a20
4 changed files with 405 additions and 410 deletions

View File

@ -22,7 +22,7 @@ import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.providers.openid.OpenIDAuthenticationToken;
import org.springframework.security.ui.AbstractProcessingFilter;
import org.springframework.security.ui.FilterChainOrder;
import org.springframework.security.ui.openid.consumers.OpenId4JavaConsumer;
import org.springframework.security.ui.openid.consumers.OpenID4JavaConsumer;
import org.springframework.security.ui.webapp.AuthenticationProcessingFilter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -40,10 +40,10 @@ import java.io.IOException;
* @version $Id$
* @since 2.0
*/
public class OpenIdAuthenticationProcessingFilter extends AbstractProcessingFilter {
public class OpenIDAuthenticationProcessingFilter extends AbstractProcessingFilter {
//~ Static fields/initializers =====================================================================================
private static final Log log = LogFactory.getLog(OpenIdAuthenticationProcessingFilter.class);
private static final Log log = LogFactory.getLog(OpenIDAuthenticationProcessingFilter.class);
public static final String DEFAULT_CLAIMED_IDENTITY_FIELD = "j_username";
//~ Instance fields ================================================================================================
@ -56,7 +56,7 @@ public class OpenIdAuthenticationProcessingFilter extends AbstractProcessingFilt
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
if (consumer == null) {
consumer = new OpenId4JavaConsumer();
consumer = new OpenID4JavaConsumer();
}
}
@ -69,7 +69,7 @@ public class OpenIdAuthenticationProcessingFilter extends AbstractProcessingFilt
// Make the username available to the view
String username = obtainUsername(req);
setLastUsername(username, req);
throw new OpenIdAuthenticationRequiredException("External Authentication Required", username);
throw new OpenIDAuthenticationRequiredException("External Authentication Required", username);
}
try {
@ -97,8 +97,8 @@ public class OpenIdAuthenticationProcessingFilter extends AbstractProcessingFilt
}
protected String determineFailureUrl(HttpServletRequest request, AuthenticationException failed) {
if (failed instanceof OpenIdAuthenticationRequiredException) {
OpenIdAuthenticationRequiredException openIdRequiredException = (OpenIdAuthenticationRequiredException) failed;
if (failed instanceof OpenIDAuthenticationRequiredException) {
OpenIDAuthenticationRequiredException openIdRequiredException = (OpenIDAuthenticationRequiredException) failed;
String claimedIdentity = openIdRequiredException.getClaimedIdentity();
if (StringUtils.hasText(claimedIdentity)) {
@ -155,9 +155,9 @@ public class OpenIdAuthenticationProcessingFilter extends AbstractProcessingFilt
protected void onUnsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response,
AuthenticationException failed) throws IOException {
if (failed instanceof OpenIdAuthenticationRequiredException) {
OpenIdAuthenticationRequiredException openIdAuthenticationRequiredException = (OpenIdAuthenticationRequiredException) failed;
request.setAttribute(OpenIdAuthenticationRequiredException.class.getName(),
if (failed instanceof OpenIDAuthenticationRequiredException) {
OpenIDAuthenticationRequiredException openIdAuthenticationRequiredException = (OpenIDAuthenticationRequiredException) failed;
request.setAttribute(OpenIDAuthenticationRequiredException.class.getName(),
openIdAuthenticationRequiredException.getClaimedIdentity());
}
}

View File

@ -19,11 +19,11 @@ import org.springframework.security.AuthenticationException;
/**
* @author Ray Krueger
*/
public class OpenIdAuthenticationRequiredException extends AuthenticationException {
public class OpenIDAuthenticationRequiredException extends AuthenticationException {
private final String claimedIdentity;
public OpenIdAuthenticationRequiredException(String msg, String claimedIdentity) {
public OpenIDAuthenticationRequiredException(String msg, String claimedIdentity) {
super(msg);
this.claimedIdentity = claimedIdentity;
}

View File

@ -41,22 +41,21 @@ import javax.servlet.http.HttpSession;
/**
* DOCUMENT ME!
*
* @author Ray Krueger
*/
public class OpenId4JavaConsumer implements OpenIDConsumer {
public class OpenID4JavaConsumer implements OpenIDConsumer {
//~ Instance fields ================================================================================================
private final ConsumerManager consumerManager;
//~ Constructors ===================================================================================================
public OpenId4JavaConsumer(ConsumerManager consumerManager) {
public OpenID4JavaConsumer(ConsumerManager consumerManager) {
this.consumerManager = consumerManager;
}
public OpenId4JavaConsumer() throws ConsumerException {
public OpenID4JavaConsumer() throws ConsumerException {
this(new ConsumerManager());
}

View File

@ -17,11 +17,9 @@ package org.springframework.security.providers.openid;
import junit.framework.TestCase;
/**
* DOCUMENT ME!
*
* @author Ray Krueger
*/
public class OpenIdAuthenticationTokenTests extends TestCase {
public class OpenIDAuthenticationTokenTests extends TestCase {
public void test() throws Exception {
OpenIDAuthenticationToken token = newToken();
@ -34,6 +32,4 @@ public class OpenIdAuthenticationTokenTests extends TestCase {
"http://raykrueger.blogspot.com/",
"what is this for anyway?");
}
}