title: how to implement Spring Security SpEL isFullyAuthenticated() programmatically in a controller?
body: <p>I have a controller where I would like to check if a user in Fully Authenticated similar to what Spring Security <code>isFullyAuthenticated()</code> expression provides. How do I do that?</p>
  
  <p>Solution I am using based on Tomasz Nurkiewicz answer below and just stealing the implementation from org.springframework.security.access.expression.SecurityExpressionRoot </p>
  
  <pre><code> public class SpringSecurityUtils {
      private static final AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
  
      public static boolean isFullyAuthenticated()
      {
          Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
          return !trustResolver.isAnonymous(authentication) &amp;&amp; !trustResolver.isRememberMe(authentication);
      }
  }
  </code></pre>