Generic Login function given a token and a secret