merging auth_token generation