encode authid and authtoken