From 1a0fa5ec27d4fd749444451acbac476f4161f402 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Mon, 24 Aug 2009 10:46:53 +0000 Subject: [PATCH] Deprecated Acegi --- .../ws/soap/security/support/AcegiUtils.java | 25 ++++++++++++------- ...gestPasswordValidationCallbackHandler.java | 3 ++- ...TextPasswordValidationCallbackHandler.java | 1 + ...iCertificateValidationCallbackHandler.java | 3 ++- ...gestPasswordValidationCallbackHandler.java | 5 ++-- ...TextPasswordValidationCallbackHandler.java | 8 +++--- .../AcegiUsernamePasswordCallbackHandler.java | 1 + 7 files changed, 30 insertions(+), 16 deletions(-) diff --git a/security/src/main/java/org/springframework/ws/soap/security/support/AcegiUtils.java b/security/src/main/java/org/springframework/ws/soap/security/support/AcegiUtils.java index 5f57979f..e9274d55 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/support/AcegiUtils.java +++ b/security/src/main/java/org/springframework/ws/soap/security/support/AcegiUtils.java @@ -1,10 +1,11 @@ -/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited +/* + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,27 +16,33 @@ package org.springframework.ws.soap.security.support; -import org.acegisecurity.userdetails.UserDetails; -import org.acegisecurity.LockedException; -import org.acegisecurity.DisabledException; import org.acegisecurity.AccountExpiredException; import org.acegisecurity.CredentialsExpiredException; +import org.acegisecurity.DisabledException; +import org.acegisecurity.LockedException; +import org.acegisecurity.userdetails.UserDetails; /** * Generic utility methods for Spring Security * * @author Tareq Abedrabbo * @since 1.5.8 + * @deprecated As of Spring-WS 1.5, in favor of Spring Security */ public abstract class AcegiUtils { /** * Checks the validity of a user's account and credentials. + * * @param user the user to check - * @throws org.springframework.security.AccountExpiredException if the account has expired - * @throws org.springframework.security.CredentialsExpiredException if the credentials have expired - * @throws org.springframework.security.DisabledException if the account is disabled - * @throws org.springframework.security.LockedException if the account is locked + * @throws org.springframework.security.AccountExpiredException + * if the account has expired + * @throws org.springframework.security.CredentialsExpiredException + * if the credentials have expired + * @throws org.springframework.security.DisabledException + * if the account is disabled + * @throws org.springframework.security.LockedException + * if the account is locked */ public static void checkUserValidity(UserDetails user) throws AccountExpiredException, CredentialsExpiredException, DisabledException, LockedException { diff --git a/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java b/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java index edbc95f7..0e88580a 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java +++ b/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java @@ -33,9 +33,9 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; import org.springframework.util.Assert; import org.springframework.ws.soap.security.callback.CleanupCallback; +import org.springframework.ws.soap.security.support.AcegiUtils; import org.springframework.ws.soap.security.wss4j.callback.AbstractWsPasswordCallbackHandler; import org.springframework.ws.soap.security.wss4j.callback.UsernameTokenPrincipalCallback; -import org.springframework.ws.soap.security.support.AcegiUtils; /** * Callback handler that validates a password digest using an Acegi UserDetailsService. Logic based on @@ -48,6 +48,7 @@ import org.springframework.ws.soap.security.support.AcegiUtils; * @see org.acegisecurity.userdetails.UserDetailsService * @see org.acegisecurity.ui.digestauth.DigestProcessingFilter * @since 1.5.0 + * @deprecated As of Spring-WS 1.5, in favor of Spring Security */ public class AcegiDigestPasswordValidationCallbackHandler extends AbstractWsPasswordCallbackHandler implements InitializingBean { diff --git a/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java b/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java index 52bc180f..623893a7 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java +++ b/security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java @@ -44,6 +44,7 @@ import org.springframework.ws.soap.security.wss4j.callback.AbstractWsPasswordCal * @see org.acegisecurity.providers.UsernamePasswordAuthenticationToken * @see org.acegisecurity.ui.basicauth.BasicProcessingFilter * @since 1.5.0 + * @deprecated As of Spring-WS 1.5, in favor of Spring Security */ public class AcegiPlainTextPasswordValidationCallbackHandler extends AbstractWsPasswordCallbackHandler implements InitializingBean { diff --git a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiCertificateValidationCallbackHandler.java b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiCertificateValidationCallbackHandler.java index fda54f61..4f7f8643 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiCertificateValidationCallbackHandler.java +++ b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiCertificateValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ import org.springframework.ws.soap.security.callback.CleanupCallback; * @see org.acegisecurity.ui.x509.X509ProcessingFilter * @see CertificateValidationCallback * @since 1.0.0 + * @deprecated As of Spring-WS 1.5, in favor of Spring Security */ public class AcegiCertificateValidationCallbackHandler extends AbstractCallbackHandler implements InitializingBean { diff --git a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java index 8874618b..e75b1b96 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java +++ b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiDigestPasswordValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,8 +35,8 @@ import org.springframework.dao.DataAccessException; import org.springframework.util.Assert; import org.springframework.ws.soap.security.callback.AbstractCallbackHandler; import org.springframework.ws.soap.security.callback.CleanupCallback; -import org.springframework.ws.soap.security.xwss.callback.DefaultTimestampValidator; import org.springframework.ws.soap.security.support.AcegiUtils; +import org.springframework.ws.soap.security.xwss.callback.DefaultTimestampValidator; /** * Callback handler that validates a password digest using an Acegi UserDetailsService. Logic based on @@ -54,6 +54,7 @@ import org.springframework.ws.soap.security.support.AcegiUtils; * @see com.sun.xml.wss.impl.callback.PasswordValidationCallback.DigestPasswordRequest * @see org.acegisecurity.ui.digestauth.DigestProcessingFilter * @since 1.0.0 + * @deprecated As of Spring-WS 1.5, in favor of Spring Security */ public class AcegiDigestPasswordValidationCallbackHandler extends AbstractCallbackHandler implements InitializingBean { diff --git a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java index bf9dd453..f8340ddf 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java +++ b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiPlainTextPasswordValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,6 +49,7 @@ import org.springframework.ws.soap.security.callback.CleanupCallback; * @see com.sun.xml.wss.impl.callback.PasswordValidationCallback.PlainTextPasswordRequest * @see org.acegisecurity.ui.basicauth.BasicProcessingFilter * @since 1.0.0 + * @deprecated As of Spring-WS 1.5, in favor of Spring Security */ public class AcegiPlainTextPasswordValidationCallbackHandler extends AbstractCallbackHandler implements InitializingBean { @@ -98,8 +99,9 @@ public class AcegiPlainTextPasswordValidationCallbackHandler extends AbstractCal PasswordValidationCallback.PlainTextPasswordRequest plainTextRequest = (PasswordValidationCallback.PlainTextPasswordRequest) request; try { - Authentication authResult = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken( - plainTextRequest.getUsername(), plainTextRequest.getPassword())); + Authentication authResult = authenticationManager.authenticate( + new UsernamePasswordAuthenticationToken(plainTextRequest.getUsername(), + plainTextRequest.getPassword())); if (logger.isDebugEnabled()) { logger.debug("Authentication success: " + authResult.toString()); } diff --git a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiUsernamePasswordCallbackHandler.java b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiUsernamePasswordCallbackHandler.java index b915419f..207ff610 100644 --- a/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiUsernamePasswordCallbackHandler.java +++ b/security/src/main/java/org/springframework/ws/soap/security/xwss/callback/acegi/AcegiUsernamePasswordCallbackHandler.java @@ -36,6 +36,7 @@ import org.springframework.ws.soap.security.callback.AbstractCallbackHandler; * * @author Arjen Poutsma * @since 1.5.0 + * @deprecated As of Spring-WS 1.5, in favor of Spring Security */ public class AcegiUsernamePasswordCallbackHandler extends AbstractCallbackHandler {