Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between isAuthenticated and isFullyAuthenticated

I'm trying to learn spring security, and I have question: what is the difference between isAuthenticated and isFullyAuthenticated in spring security

like image 851
Jhon Avatar asked Jun 20 '15 11:06

Jhon


2 Answers

From the spring-security documentation:

isAuthenticated()       Returns true if the user is not anonymous isFullyAuthenticated()  Returns true if the user is not an anonymous or a remember-me user 
like image 170
smoggers Avatar answered Oct 01 '22 01:10

smoggers


Actually, I think they explain better in the AuthenticatedVoter documentation:

The current Authentication will be inspected to determine if the principal has a particular level of authentication.

The "FULLY" authenticated option means the user is authenticated fully (ie AuthenticationTrustResolver.isAnonymous(Authentication) is false and AuthenticationTrustResolver.isRememberMe(Authentication) is false.

The "REMEMBERED" will grant access if the principal was either authenticated via remember-me Or is fully authenticated. The "ANONYMOUSLY" will grant access if the principal was authenticated via remember-me, OR anonymously, OR via full authentication.

And in this table of their docs they mention:

isAuthenticated() - Returns true if the user is not anonymous

isFullyAuthenticated() - Returns true if the user is not an anonymous or a remember-me user

like image 24
Armfoot Avatar answered Oct 01 '22 01:10

Armfoot