added support for token based auth