@ -79,6 +93,7 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@@ -79,6 +93,7 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@ -95,6 +110,14 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@@ -95,6 +110,14 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@ -148,13 +171,19 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@@ -148,13 +171,19 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@ -170,7 +199,7 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@@ -170,7 +199,7 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
// Password incorrect, so ensure we're using most current password
if(cacheWasUsed){
cacheWasUsed=false;
user=getUserFromBackend(authentication);
user=getUserFromBackend(username);
}
if(!isPasswordCorrect(authentication,user)){
@ -194,9 +223,15 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@@ -194,9 +223,15 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
}
}
ObjectprincipalToReturn=user;
if(forcePrincipalAsString){
principalToReturn=user.getUsername();
}
// Ensure we return the original credentials the user supplied,
// so subsequent attempts are successful even with encoded passwords
@ -220,10 +255,9 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@@ -220,10 +255,9 @@ public class DaoAuthenticationProvider implements AuthenticationProvider,
@ -166,7 +166,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
@@ -166,7 +166,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
@ -192,7 +192,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
@@ -192,7 +192,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
@ -199,8 +200,8 @@ public class BasicProcessingFilterTests extends TestCase {
@@ -199,8 +200,8 @@ public class BasicProcessingFilterTests extends TestCase {
@ -291,8 +292,8 @@ public class BasicProcessingFilterTests extends TestCase {
@@ -291,8 +292,8 @@ public class BasicProcessingFilterTests extends TestCase {
@ -99,8 +101,11 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
@@ -99,8 +101,11 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
@ -96,9 +97,15 @@ public class ContactSecurityVoter implements AccessDecisionVoter {
@@ -96,9 +97,15 @@ public class ContactSecurityVoter implements AccessDecisionVoter {
@ -54,8 +56,14 @@ public class WebContactAddController extends SimpleFormController {
@@ -54,8 +56,14 @@ public class WebContactAddController extends SimpleFormController {