code: public Account check(AuthenticationToken authenticationToken) {
          Account account = authenticate(authenticationToken);
          if (account == null) {
              throw new AuthenticationException("Invalid credentials");
          }
          return account;
      }
docs: Tries to authenticate an AuthenticationToken.
  
  @param authenticationToken
  @return an Account instance if authentication is successful, otherwise throws an AuthenticationException