working with converting to token based auth