private boolean hasAuthenticatedMolgenisToken() {
    boolean hasAuthenticatedMolgenisToken = false;
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (authentication instanceof RestAuthenticationToken) {
      hasAuthenticatedMolgenisToken = authentication.isAuthenticated();
    }
    return hasAuthenticatedMolgenisToken;
  }
private boolean hasAuthenticatedMolgenisToken ( ) { boolean hasAuthenticatedMolgenisToken = false ; Authentication authentication = SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; if ( authentication instanceof RestAuthenticationToken ) { hasAuthenticatedMolgenisToken = authentication . isAuthenticated ( ) ; } return hasAuthenticatedMolgenisToken ; }
Check on authenticated RestAuthenticationToken

@return authenticated {@link RestAuthenticationToken}