Skip to content

Commit f84c4ea

Browse files
Merge branch '5.8.x' into 6.1.x
Closes gh-14665
2 parents 8d6ede2 + 2c9dc08 commit f84c4ea

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/main/java/org/springframework/security/access/vote/AuthenticatedVoter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ public class AuthenticatedVoter implements AccessDecisionVoter<Object> {
6161
private AuthenticationTrustResolver authenticationTrustResolver = new AuthenticationTrustResolverImpl();
6262

6363
private boolean isFullyAuthenticated(Authentication authentication) {
64-
return (!this.authenticationTrustResolver.isAnonymous(authentication)
65-
&& !this.authenticationTrustResolver.isRememberMe(authentication));
64+
return this.authenticationTrustResolver.isFullyAuthenticated(authentication);
6665
}
6766

6867
public void setAuthenticationTrustResolver(AuthenticationTrustResolver authenticationTrustResolver) {

core/src/test/java/org/springframework/security/access/vote/AuthenticatedVoterTests.java

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public void testAnonymousWorks() {
5959
assertThat(AccessDecisionVoter.ACCESS_GRANTED).isEqualTo(voter.vote(createAnonymous(), null, def));
6060
assertThat(AccessDecisionVoter.ACCESS_GRANTED).isEqualTo(voter.vote(createRememberMe(), null, def));
6161
assertThat(AccessDecisionVoter.ACCESS_GRANTED).isEqualTo(voter.vote(createFullyAuthenticated(), null, def));
62+
assertThat(AccessDecisionVoter.ACCESS_DENIED).isEqualTo(voter.vote(null, null, def));
6263
}
6364

6465
@Test
@@ -68,6 +69,7 @@ public void testFullyWorks() {
6869
assertThat(AccessDecisionVoter.ACCESS_DENIED).isEqualTo(voter.vote(createAnonymous(), null, def));
6970
assertThat(AccessDecisionVoter.ACCESS_DENIED).isEqualTo(voter.vote(createRememberMe(), null, def));
7071
assertThat(AccessDecisionVoter.ACCESS_GRANTED).isEqualTo(voter.vote(createFullyAuthenticated(), null, def));
72+
assertThat(AccessDecisionVoter.ACCESS_DENIED).isEqualTo(voter.vote(null, null, def));
7173
}
7274

7375
@Test
@@ -77,6 +79,7 @@ public void testRememberMeWorks() {
7779
assertThat(AccessDecisionVoter.ACCESS_DENIED).isEqualTo(voter.vote(createAnonymous(), null, def));
7880
assertThat(AccessDecisionVoter.ACCESS_GRANTED).isEqualTo(voter.vote(createRememberMe(), null, def));
7981
assertThat(AccessDecisionVoter.ACCESS_GRANTED).isEqualTo(voter.vote(createFullyAuthenticated(), null, def));
82+
assertThat(AccessDecisionVoter.ACCESS_DENIED).isEqualTo(voter.vote(null, null, def));
8083
}
8184

8285
@Test

0 commit comments

Comments
 (0)