@Override
        public Optional<AuthState> getAuthState() {
            return Optional.ofNullable(state);
        }
@param account              The user account to check
@param isValidStateSupplier Should return true for a valid state.
@throws BadRequestException if user is in an invalid state
stroom-security/stroom-security-identity/src/main/java/stroom/security/identity/authenticate/AuthenticationServiceImpl.java