Testing the token-based authentication