Authentication problem

Basically, the problem is that if I present a valid token and I have access to, for instance, Alparray everything works. But if I present the same token without access to Alparray, then the authentication fails with a weird message (Wrong Format!).